forked from litl/backoff
-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (105 loc) · 3.36 KB
/
Copy pathci.yaml
File metadata and controls
114 lines (105 loc) · 3.36 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
111
112
113
114
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
permissions: {}
jobs:
build-package:
name: Build & verify package
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: read # for checkout
outputs:
supported-python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: hynek/build-and-inspect-python-package@2abe76da66d0a6a4a227101f9348ee855797cfa5 # v3.0.1
id: baipp
actionlint:
name: Static analysis of GitHub Actions
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: read # for checkout
checks: write # for reviewdog annotations
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: reviewdog/action-actionlint@d63ba7532e0942965320cd8d73cbae4c7b3c5283 # v1.73.1
lint:
name: Static analysis of code
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: read # for checkout
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.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: ubuntu-24.04
timeout-minutes: 5
needs: build-package
permissions:
contents: read # for checkout
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJson(needs.build-package.outputs.supported-python-versions) }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
include-hidden-files: true
name: coverage-data-py${{ matrix.python-version }}
path: ".coverage.*"
coverage:
name: Coverage
runs-on: ubuntu-24.04
timeout-minutes: 5
needs: test
permissions:
contents: read # for checkout
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: coverage-data-*
merge-multiple: true
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Combine coverage data and generate report
run: uvx --with tox-uv tox -e coverage