-
Notifications
You must be signed in to change notification settings - Fork 65
Check (but not fix) Fortran format in GitHub actions #717
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
base: develop
Are you sure you want to change the base?
Conversation
64b1798 to
4cc9c80
Compare
8e7925c to
e115fe9
Compare
e115fe9 to
6214664
Compare
| !!XXgoldyXX: To do, statistics output | ||
| module ccpp_hash_table | ||
|
|
||
| ! Modify this file ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 4-5 will be removed before merging the PR, this will allow the newly added test to pass.
dustinswales
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@climbfuji This is great. Thanks!
I wonder if we could add a github secret and allow the workflow to be run from forks?
(I will look into this...)
| # echo "Formatting issues detected. Run 'codee format' locally or attach label 'fix-fortran-format' to this PR." | ||
| # exit 1 | ||
| # | ||
| # This doesn't work if the pull request comes from a fork ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could we use a github token with appropriate permissions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's complicated. You need to configure a PAT for every single individual who creates a PR. Not worth the effort imo.
Check (but not fix) Fortran format in GitHub actions.
Note. The newly added GitHub actions workflow is currently failing intentionally to illustrate how the setup works. The temporary change to the Fortran source code that triggers this failure will be reverted so that all tests pass before this PR is merged.
This PR enables automated checking of the Fortran format using Codee in GitHub actions. The new test will fail if running Codee updates files that are modified in a pull request. The system tells the user to either run Codee locally (which is almost trivial when following the GitHub workflow) or applying a diff that the system produces.
This PR does not enable automatic reformatting and updates of pull requests, because this doesn't work if the pull request comes from a fork (which we usually require for the ccpp-framework repository). The stencil code to do this is submitted as comment in the current PR, however.
The checking is limited to the static Fortran source files in this repository, not the auto-generated Fortran code from
capgenorprebuild- this will be addressed in a future PR.While at it, I updated the existing GitHub workflows to run on
developonly, sincemainis now frozen`, and to avoid concurrent workflow runs (i.e. cancel currently running tests from the same pull request if an update is pushed).User interface changes?: No
Working toward #703
Testing:
test removed: n/a
unit tests: all pass
system tests: all pass (see note above about newly added test)
manual testing: n/a
test added: GitHub actions test to check formatting of static Fortran source files in this repository