-
Notifications
You must be signed in to change notification settings - Fork 6
110 lines (104 loc) · 3.31 KB
/
Copy pathci.yml
File metadata and controls
110 lines (104 loc) · 3.31 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: tests
on:
push:
# Avoid using all the resources/limits available by checking only
# relevant branches and tags. Other branches can be checked via PRs.
branches: [main]
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+' # Match tags that resemble a version
- 'v[0-9]+\.[0-9]+\.[0-9]+' # Match tags that resemble a version
pull_request: # Run in every PR
workflow_dispatch: # Allow manually triggering the workflow
schedule:
# Run roughly every 15 days at 00:00 UTC
# (useful to check if updates on dependencies break the package)
- cron: "0 0 1,16 * *"
concurrency:
group: >-
${{ github.workflow }}-${{ github.ref_type }}-
${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
name: Check (on Python 3.12)
steps:
- uses: actions/checkout@v6
- name: "Set up Python"
uses: actions/setup-python@v6
with:
python-version-file: ".python-version"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: '.pre-commit-config.yaml'
version: "0.10.9"
- name: Install dev dependencies
run: uv sync --only-group dev --frozen
- uses: tox-dev/action-pre-commit-uv@v1
test:
needs: check
strategy:
fail-fast: false
matrix:
python:
- "3.10"
- "3.11"
- "3.12"
platform:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.platform }}
name: "Test (${{ matrix.platform }} on Python ${{ matrix.python }})"
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
version: "0.10.9"
python-version: ${{ matrix.python }}
- name: Install dependencies
run: uv sync --frozen --group test
- name: Run tests
run: uv run pytest tests --ignore=tests/s2 -rFEx --durations 10 --color yes --cov
- name: Show coverage report
run: uv run coverage report
- name: Generate coverage report
run: uv run coverage lcov -o coverage.lcov
- name: Upload partial coverage report
uses: coverallsapp/github-action@v2
with:
fail-on-error: false
path-to-lcov: coverage.lcov
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: ${{ matrix.platform }} - py${{ matrix.python }}
parallel: true
test-s2:
needs: check
runs-on: ubuntu-latest
name: "Test S2 (on Python 3.12)"
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
version: "0.10.9"
python-version-file: ".python-version"
- name: Install dependencies
run: uv sync --frozen --extra s2 --group test
- name: Run S2 tests
run: uv run pytest tests/s2 -rFEx --durations 10 --color yes
finalize:
needs: [ test, test-s2]
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
fail-on-error: false
parallel-finished: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: echo "Finished checks"