-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (68 loc) · 2.5 KB
/
Copy pathpython-tests.yaml
File metadata and controls
79 lines (68 loc) · 2.5 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
70
71
72
73
74
75
76
77
78
79
name: Python Tests
on:
merge_group:
pull_request:
types: [opened, reopened, synchronize]
branches:
- 'main'
push:
branches:
- 'main'
workflow_dispatch: {}
jobs:
pytest:
if: github.repository != 'milaboratory/platforma-sequence-properties'
runs-on: ubuntu-latest
defaults:
run:
working-directory: software
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.11.16"
enable-cache: true
cache-dependency-glob: software/uv.lock
- name: Install dependencies
run: uv sync --locked
- name: Ruff check
run: uv run ruff check
- name: Ruff format check
run: uv run ruff format --check
- name: Run pytest
# Exclude @slow (the perf benchmark) from the gate — it asserts a
# wall-clock budget that flakes on shared runners. Run it explicitly
# with `uv run pytest -m slow`.
run: uv run pytest -m "not slow"
requirements-sync:
# src/requirements.txt is generated from pyproject.toml (the single source of
# truth) and is what pl-pkg builds from. This job fails if the committed file
# has drifted from pyproject — e.g. someone changed a dependency but forgot to
# regenerate. Fix locally with `pnpm deps:export` (see software/package.json).
if: github.repository != 'milaboratory/platforma-sequence-properties'
runs-on: ubuntu-latest
defaults:
run:
working-directory: software
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.11.16"
enable-cache: true
cache-dependency-glob: software/uv.lock
- name: Regenerate requirements.txt from pyproject.toml
# Same script `pnpm deps:export` runs locally — single source of truth.
run: bash scripts/deps-export.sh
- name: Verify requirements.txt is in sync with pyproject.toml
run: |
if ! git diff --exit-code -- src/requirements.txt; then
echo ""
echo "::error::src/requirements.txt is out of sync with pyproject.toml"
echo "Dependencies are defined in software/pyproject.toml; src/requirements.txt is generated."
echo "Resolve locally with:"
echo " cd software && pnpm deps:export"
echo "then commit the updated src/requirements.txt."
exit 1
fi
echo "src/requirements.txt is in sync with pyproject.toml."