Skip to content

Commit b8335df

Browse files
committed
Convert to using nox GHA
1 parent 60c7262 commit b8335df

File tree

1 file changed

+30
-36
lines changed

1 file changed

+30
-36
lines changed

.github/workflows/reusable-nox.yml

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,44 @@ name: nox
33

44
"on":
55
workflow_call:
6+
inputs:
7+
python-versions:
8+
description: Space-seperated list of python version(s) to run nox sessions with
9+
type: string
10+
required: false
11+
default: "3.12"
12+
sessions:
13+
description: Space-seperated list of sessions
14+
type: string
15+
required: false
16+
default: "static formatters_check typing spelling checkers(rstcheck) checkers(rst-yamllint) checkers(docs-build) actionlint"
17+
618

719
jobs:
820
nox:
921
runs-on: ubuntu-latest
10-
strategy:
11-
fail-fast: false
12-
matrix:
13-
include:
14-
# Inputs:
15-
# session: name of session
16-
# python-versions: comma-separated list of Python versions to install
17-
# extra-args (optional): extra arguments to pass to nox session.
18-
- session: static
19-
python-versions: "3.12"
20-
- session: formatters_check
21-
python-versions: "3.12"
22-
- session: typing
23-
python-versions: "3.12"
24-
- session: spelling
25-
python-versions: "3.12"
26-
- session: "checkers(rstcheck)"
27-
python-versions: "3.12"
28-
- session: "checkers(rst-yamllint)"
29-
python-versions: "3.12"
30-
- session: "checkers(docs-build)"
31-
python-versions: "3.12"
32-
- session: "actionlint"
33-
python-versions: "3.12"
34-
- session: "pip-compile"
35-
extra-args: "--check"
36-
python-versions: "3.12"
37-
name: "Run nox ${{ matrix.session }} session"
22+
name: "Run nox sessions"
3823
steps:
3924
- name: Check out repo
4025
uses: actions/checkout@v5
26+
4127
- name: Setup nox
4228
uses: wntrblm/[email protected]
4329
with:
44-
python-versions: "${{ matrix.python-versions }}"
30+
python-versions: "${{ inputs.python-versions }}"
31+
4532
- name: Graft ansible-core
46-
run: |
47-
nox -e clone-core
48-
- name: "Run nox -e ${{ matrix.session }}"
49-
run: |
50-
# Using GHA expression interpolation is fine here,
51-
# as we control all the inputs.
52-
nox -e "${{ matrix.session }}" -- ${{ matrix.extra-args }}
33+
uses: x1101/github-action-run-nox@ca8b16f76c53a04b14952620e7a4ac5c7dc29812
34+
with:
35+
sessions: clone-core
36+
37+
- name: "Run nox sessions"
38+
uses: x1101/github-action-run-nox@ca8b16f76c53a04b14952620e7a4ac5c7dc29812
39+
with:
40+
sessions: "${{ inputs.sessions }}"
41+
42+
- name: "Run Sessions with Args"
43+
uses: x1101/github-action-run-nox@ca8b16f76c53a04b14952620e7a4ac5c7dc29812
44+
with:
45+
sessions: "pip-compile"
46+
extra-args: "--check"

0 commit comments

Comments
 (0)