Skip to content

Commit 9410391

Browse files
committed
Start re-working actions
1 parent 5057c5d commit 9410391

File tree

2 files changed

+147
-106
lines changed

2 files changed

+147
-106
lines changed

.github/workflows/code_quality.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# This does code inspection and checks to make sure building of docs works
2+
3+
name: GitHub based tests
4+
5+
on:
6+
push:
7+
branches: [development, maintenance]
8+
pull_request:
9+
branches: [development, maintenance]
10+
workflow_dispatch:
11+
12+
jobs:
13+
14+
build:
15+
name: Code inspections
16+
runs-on: ${{ matrix.os }}
17+
18+
strategy:
19+
matrix:
20+
os: [ubuntu-latest]
21+
python-version: ['3.12']
22+
architecture: ['x64']
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: setup
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
architecture: ${{ matrix.architecture }}
31+
32+
- name: dependencies
33+
run: |
34+
python -m pip install -U pip wheel setuptools
35+
- name: wheel
36+
id: wheel
37+
run: |
38+
python -m pip install -e .[dev]
39+
- name: "code-inspection: formatting"
40+
if: ${{ (success() || failure()) && steps.wheel.outcome == 'success' }}
41+
run: |
42+
python ./make.py format --check
43+
- name: "code-inspection: ruff-check"
44+
if: ${{ (success() || failure()) && steps.wheel.outcome == 'success' }}
45+
run: |
46+
python ./make.py ruff-check
47+
- name: "code-inspection: mypy"
48+
if: ${{ (success() || failure()) && steps.wheel.outcome == 'success' }}
49+
run: |
50+
python ./make.py mypy
51+
- name: "code-inspection: pyright"
52+
if: ${{ (success() || failure()) && steps.wheel.outcome == 'success' }}
53+
run: |
54+
python ./make.py pyright
55+
# Prepare the Pull Request Payload artifact. If this fails,
56+
# we fail silently using the `continue-on-error` option. It's
57+
# nice if this succeeds, but if it fails for any reason, it
58+
# does not mean that our lint-test checks failed.
59+
- name: Prepare Pull Request Payload artifact
60+
id: prepare-artifact
61+
if: always() && github.event_name == 'pull_request'
62+
continue-on-error: true
63+
run: cat $GITHUB_EVENT_PATH | jq '.pull_request' > pull_request_payload.json
64+
65+
# This only makes sense if the previous step succeeded. To
66+
# get the original outcome of the previous step before the
67+
# `continue-on-error` conclusion is applied, we use the
68+
# `.outcome` value. This step also fails silently.
69+
- name: Upload a Build Artifact
70+
if: always() && steps.prepare-artifact.outcome == 'success'
71+
continue-on-error: true
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: pull-request-payload
75+
path: pull_request_payload.json
76+
77+
builddoc:
78+
79+
name: Documentation build test
80+
runs-on: ${{ matrix.os }}
81+
82+
strategy:
83+
matrix:
84+
os: [ubuntu-latest]
85+
# python-version in must be kept in sync with .readthedocs.yaml
86+
python-version: ['3.10'] # July 2024 | Match our contributor dev version; see pyproject.toml
87+
architecture: ['x64']
88+
89+
steps:
90+
- uses: actions/checkout@v4
91+
- name: setup
92+
uses: actions/setup-python@v5
93+
with:
94+
python-version: ${{ matrix.python-version }}
95+
architecture: ${{ matrix.architecture }}
96+
97+
- name: dependencies
98+
run: |
99+
python -m pip install -U pip wheel setuptools
100+
- name: wheel
101+
id: wheel
102+
run: |
103+
python -m pip install -e .[dev]
104+
- name: build-docs
105+
run: |
106+
sphinx-build doc build -W
107+
# Prepare the Pull Request Payload artifact. If this fails,
108+
# we fail silently using the `continue-on-error` option. It's
109+
# nice if this succeeds, but if it fails for any reason, it
110+
# does not mean that our lint-test checks failed.
111+
- name: Prepare Pull Request Payload artifact
112+
id: prepare-artifact
113+
if: always() && github.event_name == 'pull_request'
114+
continue-on-error: true
115+
run: cat $GITHUB_EVENT_PATH | jq '.pull_request' > pull_request_payload.json
116+
117+
# This only makes sense if the previous step succeeded. To
118+
# get the original outcome of the previous step before the
119+
# `continue-on-error` conclusion is applied, we use the
120+
# `.outcome` value. This step also fails silently.
121+
- name: Upload a Build Artifact
122+
if: always() && steps.prepare-artifact.outcome == 'success'
123+
continue-on-error: true
124+
uses: actions/upload-artifact@v4
125+
with:
126+
name: pull-request-payload
127+
path: pull_request_payload.json

.github/workflows/test.yml

Lines changed: 20 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# This does code inspection and checks to make sure building of docs works
2-
3-
name: GitHub based tests
1+
name: PyTest
42

53
on:
64
push:
@@ -11,117 +9,33 @@ on:
119

1210
jobs:
1311

14-
build:
15-
name: Code inspections
16-
runs-on: ${{ matrix.os }}
17-
12+
linux:
13+
runs-on: ubuntu-latest
1814
strategy:
1915
matrix:
20-
os: [ubuntu-latest]
21-
python-version: ['3.12']
22-
architecture: ['x64']
23-
16+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
17+
18+
name: Python ${{ matrix.python-version }}
2419
steps:
25-
- uses: actions/checkout@v4
26-
- name: setup
20+
- uses: actions/checkout@v5
21+
22+
- name: Install xvfb
23+
run: sudo apt-get install xvfb
24+
25+
- name: Setup Python
2726
uses: actions/setup-python@v5
2827
with:
2928
python-version: ${{ matrix.python-version }}
30-
architecture: ${{ matrix.architecture }}
3129

32-
- name: dependencies
33-
run: |
34-
python -m pip install -U pip wheel setuptools
35-
- name: wheel
36-
id: wheel
37-
run: |
38-
python -m pip install -e .[dev]
39-
- name: "code-inspection: formatting"
40-
if: ${{ (success() || failure()) && steps.wheel.outcome == 'success' }}
41-
run: |
42-
python ./make.py format --check
43-
- name: "code-inspection: ruff-check"
44-
if: ${{ (success() || failure()) && steps.wheel.outcome == 'success' }}
45-
run: |
46-
python ./make.py ruff-check
47-
- name: "code-inspection: mypy"
48-
if: ${{ (success() || failure()) && steps.wheel.outcome == 'success' }}
49-
run: |
50-
python ./make.py mypy
51-
- name: "code-inspection: pyright"
52-
if: ${{ (success() || failure()) && steps.wheel.outcome == 'success' }}
53-
run: |
54-
python ./make.py pyright
55-
# Prepare the Pull Request Payload artifact. If this fails,
56-
# we fail silently using the `continue-on-error` option. It's
57-
# nice if this succeeds, but if it fails for any reason, it
58-
# does not mean that our lint-test checks failed.
59-
- name: Prepare Pull Request Payload artifact
60-
id: prepare-artifact
61-
if: always() && github.event_name == 'pull_request'
62-
continue-on-error: true
63-
run: cat $GITHUB_EVENT_PATH | jq '.pull_request' > pull_request_payload.json
64-
65-
# This only makes sense if the previous step succeeded. To
66-
# get the original outcome of the previous step before the
67-
# `continue-on-error` conclusion is applied, we use the
68-
# `.outcome` value. This step also fails silently.
69-
- name: Upload a Build Artifact
70-
if: always() && steps.prepare-artifact.outcome == 'success'
71-
continue-on-error: true
72-
uses: actions/upload-artifact@v4
30+
- name: Install UV
31+
uses: astral-sh/setup-uv@v7
7332
with:
74-
name: pull-request-payload
75-
path: pull_request_payload.json
76-
77-
builddoc:
78-
79-
name: Documentation build test
80-
runs-on: ${{ matrix.os }}
33+
enable-cache: true
8134

82-
strategy:
83-
matrix:
84-
os: [ubuntu-latest]
85-
# python-version in must be kept in sync with .readthedocs.yaml
86-
python-version: ['3.10'] # July 2024 | Match our contributor dev version; see pyproject.toml
87-
architecture: ['x64']
35+
- name: Sync UV project
36+
run: uv sync
8837

89-
steps:
90-
- uses: actions/checkout@v4
91-
- name: setup
92-
uses: actions/setup-python@v5
93-
with:
94-
python-version: ${{ matrix.python-version }}
95-
architecture: ${{ matrix.architecture }}
96-
97-
- name: dependencies
98-
run: |
99-
python -m pip install -U pip wheel setuptools
100-
- name: wheel
101-
id: wheel
102-
run: |
103-
python -m pip install -e .[dev]
104-
- name: build-docs
38+
- name: Run tests
10539
run: |
106-
sphinx-build doc build -W
107-
# Prepare the Pull Request Payload artifact. If this fails,
108-
# we fail silently using the `continue-on-error` option. It's
109-
# nice if this succeeds, but if it fails for any reason, it
110-
# does not mean that our lint-test checks failed.
111-
- name: Prepare Pull Request Payload artifact
112-
id: prepare-artifact
113-
if: always() && github.event_name == 'pull_request'
114-
continue-on-error: true
115-
run: cat $GITHUB_EVENT_PATH | jq '.pull_request' > pull_request_payload.json
116-
117-
# This only makes sense if the previous step succeeded. To
118-
# get the original outcome of the previous step before the
119-
# `continue-on-error` conclusion is applied, we use the
120-
# `.outcome` value. This step also fails silently.
121-
- name: Upload a Build Artifact
122-
if: always() && steps.prepare-artifact.outcome == 'success'
123-
continue-on-error: true
124-
uses: actions/upload-artifact@v4
125-
with:
126-
name: pull-request-payload
127-
path: pull_request_payload.json
40+
xvfb-run --auto-servernum uv run arcade
41+
xvfb-run --auto-servernum uv run pytest --maxfail=10

0 commit comments

Comments
 (0)