-
Notifications
You must be signed in to change notification settings - Fork 51
62 lines (51 loc) · 1.49 KB
/
tests.yml
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
name: tests
run-name: ${{ github.actor }} is testing the package
on:
push:
branches:
- main
- release/*
pull_request:
branches:
- main
- release/*
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/0.3.0/install.sh | sh
- name: Set up Python ${{ matrix.python-version }}
run: |
uv python install ${{ matrix.python-version }}
echo "${{ matrix.python-version }}" > .python-version
- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install the project
run: uv sync --all-extras --dev
- name: Run Tests
run: uv run pytest tests/ --cov=./ --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
directory: ./
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.xml,!./cache
flags: tests
name: codecov-umbrella
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
- name: Minimize uv cache
run: uv cache prune --ci