Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GitHub Actions: Build Triggers, upload-artifact #720

Merged
merged 9 commits into from
Jan 13, 2025

Conversation

k-doering-NOAA
Copy link
Member

What is the feature?

@Bai-Li-NOAA and I worked on this to:

How have you implemented the solution?

  • Made changes to the gha YAML files.

Does the PR impact any other area of the project, maybe another repo?

  • n/a

I was a bit uncertain whether to open this to main or dev, but I think if it gets into dev, and is soon added to main as well, that would be good.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Instructions for code reviewer

Hello reviewer, thanks for taking the time to review this PR!

  • Please use this checklist during your review, checking off items that you have verified are complete!
  • For PRs that don't make changes to code (e.g., changes to README.md or Github actions workflows), feel free to skip over items on the checklist that are not relevant. Remember it is still important to do a thorough review.
  • Then, comment on the pull request with your review indicating where you have questions or changes need to be made before merging.
  • Remember to review every line of code you’ve been asked to review, look at the context, make sure you’re improving code health, and compliment developers on good things that they do.
  • PR reviews are a great way to learn, so feel free to share your tips and tricks. However, for optional changes (i.e., not required for merging), please include nit: (for nitpicking) before making the suggestion. For example, nit: I prefer using a data.frame() instead of a matrix because...
  • Engage with the developer when they respond to comments and check off additional boxes as they become complete so the PR can be merged in when all the tasks are fulfilled. Make it clear when this has been reached by commenting on the PR with something like This PR is now ready to be merged, no changes needed.

Checklist

  • The PR is requested to be merged into the appropriate branch (typically main)
  • The code is well-designed.
  • The functionality is good for the users of the code.
  • Any User Interface changes are sensible and look good.
  • The code isn’t more complex than it needs to be.
  • Code coverage remains high, indicating the new code is tested.
  • The developer used clear names for everything.
  • Comments are clear and useful, and mostly explain why instead of what.
  • Code is appropriately documented (doxygen and roxygen).

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.65%. Comparing base (7cf2c14) to head (2b8e30c).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #720      +/-   ##
==========================================
+ Coverage   66.08%   68.65%   +2.57%     
==========================================
  Files          44       44              
  Lines        4662     4703      +41     
  Branches        0      197     +197     
==========================================
+ Hits         3081     3229     +148     
+ Misses       1581     1427     -154     
- Partials        0       47      +47     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

k-doering-NOAA and others added 3 commits January 8, 2025 13:49
Allows for the newest version of clang-format to always be used by
removing the clang-format version specification. This might be causing
the issues with clang-format reordering the libraries and things
crashing on the R side when the package is tested.
@kellijohnson-NOAA
Copy link
Contributor

Thanks @k-doering-NOAA and @Bai-Li-NOAA for this PR. I rebased to dev and added one commit. I have a few questions though and will do a review soon.

@k-doering-NOAA
Copy link
Member Author

Thanks @k-doering-NOAA and @Bai-Li-NOAA for this PR. I rebased to dev and added one commit. I have a few questions though and will do a review soon.

sounds good!

Uses an if statement to know if the doxygen workflow should deploy after building now that it is built on changes to both dev and main.

References:
* https://kevsoft.net/2020/06/10/running-github-action-steps-and-jobs-only-on-push-to-master.html
* https://stackoverflow.com/questions/58139406/only-run-job-on-specific-branch-with-github-actions
Before it was ignoring paths just on workflow dispatch. Now the ignore calls are there for both PR and pushes.
Move summary above name: and arrange on in alphabetical order, as well as branch names and files are now in order too. This standardizes the way that the files are written. No actual changes to their content.
Copy link
Contributor

@kellijohnson-NOAA kellijohnson-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @k-doering-NOAA and @Bai-Li-NOAA for these changes. I rebased and then made some changes in the following commits (newest to oldest)

  • 2555d4a Refactors GitHub action yml files, puts a comment at the top of the file explaining what the file does. Orders the "on:" to always be pull_request, push, workflow_dispatch. Orders the branch references to be dev then main. Removes some generic comments.
  • d743e2d fix(call-calc-coverage): Moved and copied the list of file paths to the specific on: calls for pull_request and push because the information underneath each of the following: pull_request, push, and workflow_dispatch, are specific to each trigger. We don't actually want to ignore file paths when someone calls the workflow via dispatch just when things are automatic.
  • 5bd6bc1 refactor(build-doxygen): Uses one file instead of two files and an if statement if the workflow should deploy, where deployment happens on main only. @k-doering-NOAA can you review this change to make sure that I didn't mess things up. If you don't like it, I can revert it.
  • 6d9d728 fix(clang-format): v18 of workflow

One question I have is if we should be using @v4 or any other calls to versions? I personally think that these always become out of date and we would be better off to just use whatever version is in the main branch. Especially for workflows that are as widely used as actions/upload-artifact@v4. --Update .... I think that we should add this dependabot action instead of removing the version numbers. It is NOT recommended to remove the version number like I previously suggested. Instead it is recommended to add a workflow that will check, daily or whenever you want, to ensure that the workflows that you are using are all up to date. E.g.,

version: 2
updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "daily"

.github/workflows/call-update-pkgdown.yml Outdated Show resolved Hide resolved
@k-doering-NOAA
Copy link
Member Author

Thanks @kellijohnson-NOAA ! I replied to the q re: tags. For 5bd6bc1, I think it looks good!

I also think the dependabot action sounds like a good idea (in fact, I should use it for ghactions4r, too...) Let me know if you would like me to remove the tags line or add the dependabot action. I'm also fine if you want to add in those changes!

Copy link
Contributor

@kellijohnson-NOAA kellijohnson-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@k-doering-NOAA I removed the one call to tag and added the dependabot file. It is not currently working but my guess is that is because it has yet to be called, I set it to run just once a week rather than daily.

@kellijohnson-NOAA kellijohnson-NOAA merged commit 06d9a17 into dev Jan 13, 2025
15 checks passed
@kellijohnson-NOAA kellijohnson-NOAA deleted the dev-gha-update-triggers branch January 13, 2025 17:25
kellijohnson-NOAA added a commit that referenced this pull request Jan 17, 2025
fix(GHA): Updates GHA build triggers

* update to v4 of upload-artifact gha
* fix(clang-format): v18 of workflow; allows for the newest version of clang-format to always be used by removing the clang-format version specification. This might be causing the issues with clang-format reordering the libraries and things
crashing on the R side when the package is tested.
* refactor(build-doxygen): Uses one file with an if statement to know if the doxygen workflow should deploy after building now that it is built on changes to both dev and main.
* fix(call-calc-coverage): Ignores paths on push and PR; it was ignoring paths just on workflow dispatch. Now the ignore calls are there for both PR and pushes.
* Adds dependabot.yml file to update GitHub actions
* Removes tags as trigger in package down
* Formats the GitHub action yml files consistently; moves summary above name: and arrange on in alphabetical order, as well as branch names and files are now in order too. This standardizes the way that the files are written.

References:
* https://kevsoft.net/2020/06/10/running-github-action-steps-and-jobs-only-on-push-to-master.html
* https://stackoverflow.com/questions/58139406/only-run-job-on-specific-branch-with-github-actions

Co-authored-by: Bai-Li-NOAA <[email protected]>
Co-authored-by: kellijohnson-NOAA <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants