forked from litl/backoff
-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (81 loc) · 2.77 KB
/
ci.yaml
File metadata and controls
90 lines (81 loc) · 2.77 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
name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
schedule:
# Daily at 12:00 UTC
- cron: "0 12 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: 1
jobs:
build-package:
name: Build & verify package
runs-on: ubuntu-latest
outputs:
supported-python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- uses: hynek/build-and-inspect-python-package@efb823f52190ad02594531168b7a2d5790e66516 # v2.14.0
id: baipp
actionlint:
name: Static analysis of GitHub Actions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: reviewdog/action-actionlint@0d952c597ef8459f634d7145b0b044a9699e5e43 # v1.71.0
lint:
name: Static analysis of code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
- name: Install tox
run: uv tool install --with tox-uv tox
- name: Type checks
run: tox -e typing
- name: Lint code
run: tox -e lint
test:
name: Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
needs: build-package
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
python-version: ${{ fromJson(needs.build-package.outputs.supported-python-versions) }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
- name: Run tests
env:
PYTHON: ${{ matrix.python-version }}
run: uvx --with tox-uv tox -e "$PYTHON"
- name: Upload coverage data
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
include-hidden-files: true
name: coverage-data-${{ matrix.os }}-py${{ matrix.python-version }}
path: ".coverage.*"
coverage:
name: Coverage
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
pattern: coverage-data-*
merge-multiple: true
- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
- name: Combine coverage data and generate report
run: uvx --with tox-uv tox -e coverage