Skip to content

Commit 30732cc

Browse files
authored
make nox-session reusable workflow (#791)
* make nox-session reusable workflow * bump sphinx ver * update job names
1 parent 2720911 commit 30732cc

File tree

4 files changed

+74
-75
lines changed

4 files changed

+74
-75
lines changed

.github/workflows/.nox-session.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Nox Session
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
session-name:
7+
required: true
8+
type: string
9+
session-arguments:
10+
required: false
11+
type: string
12+
runs-on-array:
13+
required: false
14+
type: string
15+
default: '["ubuntu-latest"]'
16+
python-version-array:
17+
required: false
18+
type: string
19+
default: '["3.x"]'
20+
job-name:
21+
required: false
22+
type: string
23+
default: python-{0} {1}
24+
25+
jobs:
26+
nox-session:
27+
name: ${{ format(inputs.job-name, matrix.python-version, matrix.runs-on) }}
28+
strategy:
29+
matrix:
30+
runs-on: ${{fromJson(inputs.runs-on-array)}}
31+
python-version: ${{fromJson(inputs.python-version-array)}}
32+
runs-on: ${{ matrix.runs-on }}
33+
steps:
34+
- uses: actions/checkout@v2
35+
- uses: actions/setup-node@v2
36+
with:
37+
node-version: "14.x"
38+
- name: Install Specific NPM Version
39+
run: npm install -g [email protected]
40+
- name: Use Python ${{ matrix.python-version }}
41+
uses: actions/setup-python@v2
42+
with:
43+
python-version: ${{ matrix.python-version }}
44+
- name: Install Python Dependencies
45+
run: pip install -r requirements/nox-deps.txt
46+
- name: Run Tests
47+
env: { "CI": "true" }
48+
run: nox -s ${{ inputs.session-name }} --stop-on-first-error -- ${{ inputs.session-arguments }}

.github/workflows/test.yml

+24-73
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: test
22

33
on:
44
push:
@@ -11,75 +11,26 @@ on:
1111
- cron: "0 0 * * *"
1212

1313
jobs:
14-
test-python-coverage:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- uses: actions/checkout@v2
18-
- uses: actions/setup-node@v2
19-
with:
20-
node-version: "14.x"
21-
- name: Install Specific NPM Version
22-
run: npm install -g [email protected]
23-
- name: Use Latest Python
24-
uses: actions/setup-python@v2
25-
with:
26-
python-version: "3.9"
27-
- name: Install Python Dependencies
28-
run: pip install -r requirements/nox-deps.txt
29-
- name: Run Tests
30-
env: { "CI": "true" }
31-
run: nox -s test_python_suite -- --maxfail=3
32-
test-python-environments:
33-
runs-on: ${{ matrix.os }}
34-
strategy:
35-
matrix:
36-
python-version: ["3.7", "3.8", "3.9", "3.10"]
37-
os: [ubuntu-latest, macos-latest, windows-latest]
38-
steps:
39-
- uses: actions/checkout@v2
40-
- uses: actions/setup-node@v2
41-
with:
42-
node-version: "14.x"
43-
- name: Install Specific NPM Version
44-
run: npm install -g [email protected]
45-
- name: Use Python ${{ matrix.python-version }}
46-
uses: actions/setup-python@v2
47-
with:
48-
python-version: ${{ matrix.python-version }}
49-
- name: Install Python Dependencies
50-
run: pip install -r requirements/nox-deps.txt
51-
- name: Run Tests
52-
env: { "CI": "true" }
53-
run: nox -s test_python --stop-on-first-error -- --maxfail=3 --no-cov
54-
test-docs:
55-
runs-on: ubuntu-latest
56-
steps:
57-
- uses: actions/checkout@v2
58-
- uses: actions/setup-node@v2
59-
with:
60-
node-version: "14.x"
61-
- name: Install Specific NPM Version
62-
run: npm install -g [email protected]
63-
- name: Use Latest Python
64-
uses: actions/setup-python@v2
65-
with:
66-
python-version: "3.9"
67-
- name: Install Python Dependencies
68-
run: pip install -r requirements/nox-deps.txt
69-
- name: Run Tests
70-
env: { "CI": "true" }
71-
run: nox -s test_docs
72-
test-javascript:
73-
runs-on: ubuntu-latest
74-
steps:
75-
- uses: actions/checkout@v2
76-
- uses: actions/setup-node@v2
77-
with:
78-
node-version: "14.x"
79-
- name: Install Specific NPM Version
80-
run: npm install -g [email protected]
81-
- name: Install Python Dependencies
82-
run: pip install -r requirements/nox-deps.txt
83-
- name: Run Tests
84-
env: { "CI": "true" }
85-
run: nox -s test_javascript
14+
python-coverage:
15+
uses: ./.github/workflows/.nox-session.yml
16+
with:
17+
job-name: "python-{0}"
18+
session-name: test_python_suite
19+
session-arguments: --maxfail=3
20+
python-environments:
21+
uses: ./.github/workflows/.nox-session.yml
22+
with:
23+
session-name: test_python_suite
24+
session-arguments: --maxfail=3 --no-cov
25+
runs-on-array: '["ubuntu-latest", "macos-latest", "windows-latest"]'
26+
python-version-array: '["3.7", "3.8", "3.9", "3.10"]'
27+
docs:
28+
uses: ./.github/workflows/.nox-session.yml
29+
with:
30+
job-name: "python-{0}"
31+
session-name: test_docs
32+
javascript:
33+
uses: ./.github/workflows/.nox-session.yml
34+
with:
35+
job-name: "{1}"
36+
session-name: test_javascript

docs/source/_custom_js/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements/build-docs.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sphinx ==4.1.2
1+
sphinx ==4.2.0
22
sphinx-autodoc-typehints ==1.7.0
33
furo ==2021.10.09
44
setuptools_scm

0 commit comments

Comments
 (0)