-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (95 loc) · 3.17 KB
/
Copy pathci.yml
File metadata and controls
117 lines (95 loc) · 3.17 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
name: CI
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
permissions:
contents: read
jobs:
tests:
name: tests (py${{ matrix.python-version }})
if: ${{ github.event_name == 'pull_request' || !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: python -m pip install --upgrade pip poetry
- name: Install dependencies
run: poetry install --with dev
- name: Run test suite
run: poetry run pytest
quality:
name: quality (lint + types)
if: ${{ github.event_name == 'pull_request' || !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
run: python -m pip install --upgrade pip poetry
- name: Install dependencies
run: poetry install --with dev
- name: Check formatting (black)
run: poetry run black --check src tests
# mypy is advisory for now: there is a pre-existing type-error backlog.
# Tracked to become blocking once the baseline is clean (see
# openspec/changes/release-and-ci-hardening/tasks.md task 5.3).
- name: Type check (mypy, advisory)
continue-on-error: true
run: poetry run mypy src
sbom-check:
name: sbom freshness
if: ${{ github.event_name == 'pull_request' || !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
# The generator is stdlib-only (tomllib on 3.11+); no dependency install needed.
- name: Verify sbom.json matches poetry.lock
run: python scripts/generate_sbom.py --check
build:
name: build distribution
if: ${{ github.event_name == 'pull_request' || !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
run: python -m pip install --upgrade pip poetry
- name: Build sdist and wheel
run: poetry build
- name: Check distribution metadata
run: |
python -m pip install twine
twine check dist/*
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/