-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathci.yml
More file actions
102 lines (82 loc) · 2.47 KB
/
ci.yml
File metadata and controls
102 lines (82 loc) · 2.47 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
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
concurrency:
group: {% raw %}${{ github.workflow }}-${{ github.ref }}{% endraw %}
cancel-in-progress: true
env:
# Many color libraries just need this variable to be set to any value.
# Set it to 3 to support 8-bit color graphics (256 colors per channel)
# for libraries that care about the value set.
FORCE_COLOR: 3
jobs:
lint:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
{%- if cookiecutter.vcs %}
with:
fetch-depth: 0
{%- endif %}
- uses: actions/setup-python@v6
with:
python-version: "3.x"
- uses: astral-sh/setup-uv@v8.1.0
- uses: j178/prek-action@v2
- name: Run Pylint
run: uvx nox -s pylint -- --output-format=github
checks:
name: {% raw %}Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}{% endraw %}
runs-on: {% raw %}${{ matrix.runs-on }}{% endraw %}
{%- if cookiecutter.__type == "compiled" %}
needs: [lint]
{%- endif %}
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.14"]
runs-on: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel]
include:
- python-version: "pypy-3.11"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
{%- if cookiecutter.vcs %}
with:
fetch-depth: 0
{%- endif %}
- uses: actions/setup-python@v6
with:
python-version: {% raw %}${{ matrix.python-version }}{% endraw %}
allow-prereleases: true
- uses: astral-sh/setup-uv@v8.1.0
{%- if cookiecutter.backend == "mesonpy" %}
- name: Activate MSVC for Meson
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
{%- endif %}
- name: Install package
run: uv sync
- name: Test package
run: >-
uv run pytest -ra --cov --cov-report=xml --cov-report=term
--durations=20
- name: Upload coverage report
uses: codecov/codecov-action@v6
with:
token: {% raw %}${{ secrets.CODECOV_TOKEN }}{% endraw %}
pass:
if: always()
needs: [lint, checks]
runs-on: ubuntu-slim
timeout-minutes: 2
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: {% raw %}${{ toJSON(needs) }}{% endraw %}