-
Notifications
You must be signed in to change notification settings - Fork 446
Workflows: switch to a conda install of clang-format #7669
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
Workflows: switch to a conda install of clang-format #7669
Conversation
Allows us to pick the version without relying on what is available on the runner.
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.
not the recommended way to deal with conda tools... see "install python deps" here for a better example:
E3SM/.github/workflows/e3sm-gh-pages.yml
Lines 54 to 66 in 379e000
| - name: Install Python deps | |
| uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| init-shell: bash | |
| environment-name: docs | |
| create-args: >- | |
| python=3.12 | |
| mkdocs-material | |
| pymdown-extensions | |
| mkdocs-monorepo-plugin | |
| mdutils | |
| mkdocs-bibtex==2.18.0 | |
| marp-cli |
note how in that workflow you neve have to activate the env ... (it's all done for you)
|
also pls add workflow path itself to this section on:
pull_request:
branches: ["master"]
paths:
- 'components/eamxx/**/*.cpp'
- 'components/eamxx/**/*.hpp'
+ - .github/workflows/eamxx-gh-clang-format.yml |
|
The micromamba version worked great, with no extra verbosity in the shell. See this run on my fork. |
mjschmidt271
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.
Looks great--nice work!
|
you may need something like to make it work better and also, you can drop the "conda activate" lines later |
If workflow file is modified but no eamxx src files are, clang-format won't format any file, but we will at least ensure that the worfklow will still run correctly
Good call! The workflow was actually still running clang-format-18 (from the OS!). I am testing this on my fork now. |
30b3259 to
7efd203
Compare
- Run on forks as well - Print version before formatting files
|
Ok, seems to run as expected (see here). |
|
I defer to @mjschmidt271 on the version desired |
|
FYI, I picked 20.1.8 because...it ran! The default version we have in master (18, from the runner OS) was getting a segfault when using the new settings in #7666. Since we don't have any real reason to pick one version or another (except that it must be >=17, so that those new options will work), I just used whatever my 1st attempt with conda install gave me, which happened to be 20.1.8 and ran correctly. If you guys have any reason to prefer other versions, I can change (or we can update in the future). |
|
v20.1.8 is just fine with me. I don't really have any great attachment to a particular version as long as it works and remains consistent for the long-medium term |
Allows us to pick the version without relying on what is available on the runner.
[BFB]