-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (65 loc) · 2.22 KB
/
ci.yml
File metadata and controls
84 lines (65 loc) · 2.22 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
80
81
82
83
84
name: CI (quick)
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
jobs:
quality-checks:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
env:
NODE_OPTIONS: --max-old-space-size=4096 # increase default to 4GB for all steps in this job
strategy:
fail-fast: false
matrix:
python-version: ['3.12'] # Can add '3.13' when dependencies support it
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Ensure empty .env (for safety)
run: |
rm -f .env
touch .env
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "latest"
- name: Set up Python
run: uv python install ${{ matrix.python-version }}
- name: Cache uv dependencies
uses: actions/cache@v4
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock', 'pyproject.toml') }}
restore-keys: |
${{ runner.os }}-uv-
- name: Install dependencies
run: make install
- name: Check notebooks have no outputs
run: uv run make check-notebooks
- name: Run linting
run: uv run make lint
- name: Lint + test the transferability study
run: uv run make -C transferability check
- name: Run fast tests with coverage
run: uv run make coverage-fast
- name: Coverage comment
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
uses: py-cov-action/python-coverage-comment-action@v3
continue-on-error: true
with:
GITHUB_TOKEN: ${{ github.token }}
MERGE_COVERAGE_FILES: false
- name: Run integration tests (label-gated)
if: contains(github.event.pull_request.labels.*.name, 'integration')
run: uv run make test-integration
- name: Run slow tests (label-gated)
if: contains(github.event.pull_request.labels.*.name, 'slow')
run: uv run make test-slow
- name: Upload coverage artifacts
if: always() && hashFiles('logs/coverage/**') != ''
uses: actions/upload-artifact@v4
with:
name: coverage-report-${{ matrix.python-version }}
path: logs/coverage/