-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (63 loc) · 2.4 KB
/
Copy pathpython-tests.yaml
File metadata and controls
69 lines (63 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Python Tests
on:
merge_group:
pull_request:
types: [opened, reopened, synchronize]
branches: ['main']
push:
branches: ['main']
workflow_dispatch: {}
env:
UV_VERSION: "0.11.16"
jobs:
ruff:
runs-on: ubuntu-latest
defaults: { run: { working-directory: software } }
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with: { version: "${{ env.UV_VERSION }}", enable-cache: true, cache-dependency-glob: software/uv.lock }
- run: uv sync --all-groups --locked
- run: uv run ruff check
- run: uv run ruff format --check
pytest:
runs-on: ubuntu-latest
defaults: { run: { working-directory: software } }
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with: { version: "${{ env.UV_VERSION }}", enable-cache: true, cache-dependency-glob: software/uv.lock }
- run: uv sync --all-groups --locked
- run: uv run pytest -m "not slow"
# Off in CI. Runs only when somebody starts it by hand from the Actions tab.
#
# This is the end-to-end lane: the CLI driven over the committed fixture bed, so it is the one that
# catches a wiring fault between the modules the fast lane tests apart. Nothing gates on it now, so run
# it by hand before a release, and run `uv run pytest -q` locally, which includes it.
pytest-slow:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
defaults: { run: { working-directory: software } }
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with: { version: "${{ env.UV_VERSION }}", enable-cache: true, cache-dependency-glob: software/uv.lock }
- run: uv sync --all-groups --locked
- run: uv run pytest -m "slow"
requirements-sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version: '22.x', cache: 'pnpm' }
- run: pnpm install --frozen-lockfile
- uses: astral-sh/setup-uv@v5
with: { version: "${{ env.UV_VERSION }}" }
- run: pnpm software:reqs
- name: Verify requirements.txt in sync with pyproject.toml
run: |
if ! git diff --exit-code -- 'software/*/src/requirements.txt'; then
echo "::error::software/*/src/requirements.txt out of sync; run 'pnpm software:reqs' and commit"
exit 1
fi