-
Notifications
You must be signed in to change notification settings - Fork 453
71 lines (60 loc) · 1.91 KB
/
unit-and-integration-tests.yml
File metadata and controls
71 lines (60 loc) · 1.91 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
name: Unit and integration tests checker
permissions:
contents: read
on:
pull_request:
types: [opened, synchronize, reopened, edited]
jobs:
read-python-versions:
runs-on: ubuntu-latest
outputs:
python-versions: ${{ steps.read-versions.outputs.versions }}
steps:
- uses: actions/checkout@v6
- id: read-versions
run: |
versions=$(cat .github/supported-python-versions.json)
echo "versions=$versions" >> $GITHUB_OUTPUT
unit-and-integration-tests:
needs: read-python-versions
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version: ${{ fromJson(needs.read-python-versions.outputs.python-versions) }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v8.0.0
with:
enable-cache: false
- name: Cache uv and .venv
uses: actions/cache@v5
with:
path: |
~/.cache/uv
.venv
key: uv-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
uv-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-
- name: Sync dev deps (idempotent; fast on cache hit)
run: uv sync --extra dev --dev --extra torch
- name: Unit tests
timeout-minutes: 20
env:
PYTHONUNBUFFERED: "1"
run: |
uv run pytest -n 2 tests/unit_tests/ --reruns 3
- name: Integration tests
timeout-minutes: 20
env:
PYTHONUNBUFFERED: "1"
run: |
uv run pytest -n 2 tests/integration_tests/ --reruns 3