-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (70 loc) · 2.49 KB
/
ci.yml
File metadata and controls
85 lines (70 loc) · 2.49 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
85
name: CI
on:
push:
branches:
- main
- master
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
- name: Install dependencies
run: uv sync --dev --group=docs
- name: Ruff format check
run: uv run --dev ruff format --check --diff .
continue-on-error: true
- name: Ruff lint check
run: uv run --dev ruff check .
continue-on-error: true
- name: Pyrefly type check
run: uv run --dev pyrefly check .
- name: Pyright type probe check
run: uv run --dev pyright typing_tests
- name: Mypy type check
run: uv run --dev mypy .
- name: Stubtest runtime typing check
run: uv run --dev stubtest alternative
- name: Run tests
run: |
# Some GitHub-hosted runners export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1.
# Unset it so pytest can discover pytest-cov and pytest-benchmark via entry points,
# which are required by the addopts configured in pyproject.toml.
unset PYTEST_DISABLE_PLUGIN_AUTOLOAD
uv run --dev pytest --verbosity=2 --cov=alternative --cov-report=xml --cov-fail-under=100 --junit-xml=test-results.xml
- name: Documentation warnings treated as errors
run: uv run --group=docs sphinx-build --fail-on-warning --keep-going --builder=html docs /tmp/alternative-docs-html
- name: Upload coverage to Codecov
if: (success() || hashFiles('coverage.xml') != '') && env.CODECOV_TOKEN != ''
uses: codecov/codecov-action@v5
with:
token: ${{ env.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true
- name: Upload test results to Codecov
if: (success() || hashFiles('test-results.xml') != '') && env.CODECOV_TOKEN != ''
uses: codecov/codecov-action@v5
with:
token: ${{ env.CODECOV_TOKEN }}
files: ./test-results.xml
report_type: test_results
fail_ci_if_error: true