-
Notifications
You must be signed in to change notification settings - Fork 105
77 lines (65 loc) · 1.94 KB
/
Copy pathmain.yml
File metadata and controls
77 lines (65 loc) · 1.94 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
name: Tests and code quality checks
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
pre-commit:
name: Format + lint code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v10.2.0
- name: Cache the pre-commit hook environments
uses: actions/cache@v6
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: >-
uv run pre-commit run
--hook-stage manual --all-files --show-diff-on-failure
checks:
name: Run tests for Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
needs: [pre-commit]
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.14"] # test oldest and latest supported versions
runs-on: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v10.2.0
with:
python-version: ${{ matrix.python-version }}
# --locked so a stale uv.lock is a CI failure rather than a silent
# re-resolve.
- name: Install package
run: uv sync --locked
# Coverage and default tests (offline, and without the tests marked `slow`)
- name: Test package
env:
FPL_TEAM_ID: 742663
run: >-
uv run pytest -ra --cov --cov-report=xml --cov-report=term
--durations=20
- name: Run the slow tests
env:
FPL_TEAM_ID: 742663
run: uv run pytest -ra -m slow --durations=20
- name: Upload coverage report
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: false