Repository navigation
146 lines (138 loc) · 4.34 KB
/
Copy pathci.yml
File metadata and controls
146 lines (138 loc) · 4.34 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: CI
on:
workflow_call:
pull_request:
merge_group:
branches:
- main
push:
branches:
- main
permissions: {}
defaults:
run:
shell: bash
jobs:
test:
name: test (${{ matrix.python-version }})
env:
UV_PYTHON: ${{ matrix.python-patch }}
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.11"
python-patch: "3.11.16"
- python-version: "3.12"
python-patch: "3.12.14"
- python-version: "3.13"
python-patch: "3.13.15"
- python-version: "3.14"
python-patch: "3.14.7"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- run: bash .github/scripts/actionlint.sh
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-patch }}
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: "0.12.17"
- run: uv sync --locked
- name: Run SDK quality checks
run: uv run --locked poe checks
- name: Preserve runtime coverage
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage-for-python-${{ matrix.python-version }}
path: reports/coverage.json
if-no-files-found: error
- name: Preserve test failures and property seeds
if: ${{ failure() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: property-failures-python-${{ matrix.python-version }}
path: |
reports/unit.xml
reports/coverage-unit.xml
reports/hypothesis/seed.txt
if-no-files-found: ignore
mutation-plan:
name: Mutation inventory
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
outputs:
modules: ${{ steps.plan.outputs.modules }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Inventory every handwritten runtime module
id: plan
run: |
modules=$(bash scripts/mutation.sh --matrix)
echo "modules=$modules" >> "$GITHUB_OUTPUT"
mutation-module:
name: Mutation module (${{ matrix.module }})
needs: mutation-plan
runs-on: ubuntu-latest
timeout-minutes: 40
permissions:
contents: read
strategy:
fail-fast: false
matrix:
module: ${{ fromJSON(needs.mutation-plan.outputs.modules) }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12.14"
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: "0.12.17"
- run: uv sync --locked
- name: Mutate assigned runtime modules
env:
MUTATION_MODULE: ${{ matrix.module }}
run: uv run --locked poe mutation
- name: Preserve mutation outcomes
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: mutation-outcomes-${{ matrix.module }}
path: reports/mutation.json
if-no-files-found: error
mutation:
name: Mutation Gate
if: ${{ always() }}
needs: [mutation-plan, mutation-module]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Require every mutation module to succeed
env:
RESULTS: ${{ toJSON(needs.*.result) }}
run: jq -e 'length == 2 and all(. == "success")' <<< "$RESULTS"
quality:
name: Quality Gate
if: ${{ always() }}
needs: [test, mutation]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Require every mandatory job to succeed
env:
RESULTS: ${{ toJSON(needs.*.result) }}
run: jq -e 'length == 2 and all(. == "success")' <<< "$RESULTS"