-
Notifications
You must be signed in to change notification settings - Fork 745
Convert reusable-nox workflowk to using nox GHA #3194
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: devel
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,17 +11,17 @@ jobs: | |
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| # Inputs: | ||
| # matrix: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seeing the word from two lines above repeated looks confusing. It seems to be commented out code at glance. |
||
| # session: name of session | ||
| # python-versions: comma-separated list of Python versions to install | ||
| # extra-args (optional): extra arguments to pass to nox session. | ||
| - session: static | ||
| - session: "static" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did somebody request wrapping string literals with quotes? My preference is usually removing them as much as possible.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I was having issues isolating the individual sessions, and this was one of the steps I took to do that. Given the other fixes, there's a good chance its not needed. I'll re-test without them. |
||
| python-versions: "3.12" | ||
| - session: formatters_check | ||
| - session: "formatters_check" | ||
| python-versions: "3.12" | ||
| - session: typing | ||
| - session: "typing" | ||
| python-versions: "3.12" | ||
| - session: spelling | ||
| - session: "spelling" | ||
| python-versions: "3.12" | ||
| - session: "checkers(rstcheck)" | ||
| python-versions: "3.12" | ||
|
|
@@ -34,19 +34,27 @@ jobs: | |
| - session: "pip-compile" | ||
| extra-args: "--check" | ||
| python-versions: "3.12" | ||
|
|
||
| name: "Run nox ${{ matrix.session }} session" | ||
| steps: | ||
| - name: Check out repo | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup nox | ||
| uses: wntrblm/nox@2025.05.01 | ||
| with: | ||
| python-versions: "${{ matrix.python-versions }}" | ||
|
|
||
| - name: Graft ansible-core | ||
| run: | | ||
| nox -e clone-core | ||
| - name: "Run nox -e ${{ matrix.session }}" | ||
| run: | | ||
| # Using GHA expression interpolation is fine here, | ||
| # as we control all the inputs. | ||
| nox -e "${{ matrix.session }}" -- ${{ matrix.extra-args }} | ||
| uses: ansible-community/github-action-run-nox@v1 | ||
| with: | ||
| sessions: clone-core | ||
| force-pythons: "${{ matrix.python-versions }}" | ||
|
|
||
| - name: "Run nox session" | ||
| uses: ansible-community/github-action-run-nox@v1 | ||
| with: | ||
| sessions: "${{ matrix.session }}" | ||
| extra-args: "${{ matrix.extra-args || '' }}" | ||
| force-pythons: "${{ matrix.python-versions }}" | ||
|
Comment on lines
+54
to
+59
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's examples of splitting provisioning the venv and running the logic:
TL;DR for two steps to show up separately in CI, they should be actual separate entries in the step list (for the same session). The first one would run with |
||
|
|
||
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.
What I meant originally is that this matrix should be in the calling workflow, not the reusable one. That would be
ci.yaml.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.
I see what you mean. But I think that's a larger change to the workflow. As I understand it, the goal here is to take the existing workflow, which calls
noxdirectly from a matrix and replace it with one that uses the GHA.My preference would be to get the in-place change made and functional first before looking at reorganizing things.
That being said, if there's a strong desire to wrap that effort into this one, we can better outline that in the initial issue and I can look into tacking that too.