Repository navigation
149 lines (123 loc) · 4.3 KB
/
Copy pathci.yml
File metadata and controls
149 lines (123 loc) · 4.3 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
147
148
149
name: CI
# A draft pull request runs no jobs. `ready_for_review` is in the types so that
# marking it ready starts the run: without it the skipped jobs would stand as
# passing required checks on the commit and nothing would have tested it. A push
# to dev or main still runs, as the only test of the merged tree.
on:
push:
branches: [dev, main]
pull_request:
branches: [dev, main]
types: [opened, synchronize, reopened, ready_for_review]
jobs:
lint:
if: github.event.pull_request.draft != true
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- package: python/spec-kit
module: dfo_spec_kit
- package: python/frame-grammar
module: dfo_frame_grammar
- package: python/dfo-spec-kit-components
module: dfo_spec_kit_components
- package: python/provenance-docs
module: dfo_provenance_docs
- package: python/descriptions
module: dfo_descriptions
- package: python/client-contract
module: dfo_client_contract
defaults:
run:
working-directory: ${{ matrix.package }}
steps:
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v8.3.2
- name: Cache uv
uses: actions/cache@v6
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-${{ hashFiles(format('{0}/uv.lock', matrix.package)) }}
restore-keys: |
${{ runner.os }}-uv-
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install dependencies
run: uv sync --frozen
- name: Run ruff check
run: uv run ruff check .
- name: Run ruff format check
run: uv run ruff format --check .
- name: Run ty
run: uv run ty check src/${{ matrix.module }}
test:
if: github.event.pull_request.draft != true
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
[
python/spec-kit,
python/frame-grammar,
python/dfo-spec-kit-components,
python/provenance-docs,
python/descriptions,
python/client-contract,
]
python-version: ["3.12", "3.13"]
defaults:
run:
working-directory: ${{ matrix.package }}
steps:
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v8.3.2
- name: Cache uv
uses: actions/cache@v6
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-${{ matrix.python-version }}-${{ hashFiles(format('{0}/uv.lock', matrix.package)) }}
restore-keys: |
${{ runner.os }}-uv-${{ matrix.python-version }}-
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --frozen --python ${{ matrix.python-version }}
- name: Run pytest
run: uv run pytest
registry:
if: github.event.pull_request.draft != true
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- uses: actions/checkout@v7
with:
# full history + tags: the validator's immutability check diffs the
# registry against the latest release tag
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v8.3.2
- name: Validate code registry
run: uv run tools/validate_registry.py
- name: Validate unit registry
run: uv run tools/validate_unit_registry.py
- name: Test the registry validator
run: uv run --with jsonschema --with pyarrow --with pytest pytest tools/tests -q
- name: Validate identity vectors
run: uv run tools/validate_vectors.py
- name: Validate frame grammar vectors
run: uv run tools/validate_frame_vectors.py
- name: Validate unit vectors
run: uv run tools/validate_unit_vectors.py
- name: Validate provenance docs vectors
run: uv run tools/validate_provenance_docs_vectors.py
- name: Validate step and description vectors
run: uv run tools/validate_descriptions_vectors.py
- name: Validate the client contract
run: uv run tools/validate_client_contract.py