Repository navigation
67 lines (59 loc) · 1.64 KB
/
Copy pathtests.yml
File metadata and controls
67 lines (59 loc) · 1.64 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
name: Run tests
on:
push:
branches: [main]
pull_request:
branches: ['**']
permissions:
contents: write
pull-requests: write
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Detect changes
id: changed
uses: tj-actions/changed-files@v47
with:
files: |
benchmarks/**
tests/**
pyproject.toml
uv.lock
.github/workflows/tests.yml
- name: Install uv
if: steps.changed.outputs.any_changed == 'true'
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install deps
if: steps.changed.outputs.any_changed == 'true'
run: uv sync --frozen --group dev
- name: Run tests with coverage
if: steps.changed.outputs.any_changed == 'true'
run: |
# Clean up any existing coverage file
rm -f .coverage
CI=true uv run python -m pytest -vvs \
--forked \
--cov=benchmarks \
--cov-report=term-missing \
--cov-fail-under=0 \
tests/
# Rename coverage file for upload
if [ -f .coverage ]; then
mv .coverage coverage.dat
echo "Coverage file prepared for upload"
fi
- name: Upload coverage
if: steps.changed.outputs.any_changed == 'true' && always()
uses: actions/upload-artifact@v7
with:
name: coverage
path: coverage.dat
if-no-files-found: warn