Skip to content

Commit 874318f

Browse files
ci: update to generic gha for build step
1 parent 855bbd4 commit 874318f

File tree

2 files changed

+51
-23
lines changed

2 files changed

+51
-23
lines changed

.github/workflows/build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: reusable build step
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
python-version:
7+
required: true
8+
type: string
9+
nox-env:
10+
required: true
11+
type: string
12+
jobs:
13+
build:
14+
name: ${{ inputs.nox-env }}
15+
if: ${{ github.repository_owner == 'pypa' || github.event_name != 'schedule' }}
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ inputs.python-version }}
24+
cache: 'pip'
25+
cache-dependency-path: 'requirements.txt'
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade nox virtualenv
30+
31+
- name: Nox ${{ matrix.noxenv }}
32+
run: |
33+
python -m nox -s ${{ inputs.nox-env }}

.github/workflows/test.yml

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,29 @@ concurrency:
1313
cancel-in-progress: true
1414

1515
jobs:
16-
build:
17-
name: ${{ matrix.noxenv }}
18-
if: ${{ github.repository_owner == 'pypa' || github.event_name != 'schedule' }}
19-
runs-on: ubuntu-latest
16+
17+
build-python:
2018
strategy:
2119
matrix:
2220
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
2321
noxenv:
2422
- build
25-
- linkcheck
26-
27-
steps:
28-
- uses: actions/checkout@v4
29-
30-
- name: Set up Python
31-
uses: actions/setup-python@v5
32-
with:
33-
python-version: ${{ matrix.python }}
34-
cache: 'pip'
35-
cache-dependency-path: 'requirements.txt'
23+
uses: ./.github/workflows/build.yml
24+
with:
25+
python-version: ${{ matrix.python }}
26+
nox-env: ${{ matrix.noxenv }}
3627

37-
- name: Install dependencies
38-
run: |
39-
python -m pip install --upgrade nox virtualenv
40-
41-
- name: Nox ${{ matrix.noxenv }}
42-
run: |
43-
python -m nox -s ${{ matrix.noxenv }}
4428

29+
link-check:
30+
strategy:
31+
matrix:
32+
python: ['3.11']
33+
noxenv:
34+
- linkcheck
35+
uses: ./.github/workflows/build.yml
36+
with:
37+
python-version: ${{ matrix.python }}
38+
nox-env: ${{ matrix.noxenv }}
4539

4640
check:
4741
# This job does nothing and is only used for the branch protection
@@ -50,7 +44,8 @@ jobs:
5044
if: always()
5145

5246
needs:
53-
- build
47+
- build-python
48+
- link-check
5449

5550
runs-on: ubuntu-latest
5651

0 commit comments

Comments
 (0)