-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (64 loc) · 1.89 KB
/
Copy pathtest.yml
File metadata and controls
74 lines (64 loc) · 1.89 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
name: test
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout SDK
uses: actions/checkout@v4
with:
path: sdk-python
- name: Checkout spec (sibling clone, for fixtures)
uses: actions/checkout@v4
with:
repository: openagp/spec
path: spec
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install SDK with dev extras
working-directory: sdk-python
run: pip install --upgrade pip && pip install -e ".[dev]"
- name: Verify bundled schemas are in sync with spec/schemas/
working-directory: sdk-python
run: |
set -euo pipefail
for f in ../spec/schemas/*.json; do
name=$(basename "$f")
if ! cmp -s "$f" "openagp/_schemas/$name"; then
echo "::error file=openagp/_schemas/$name::out of sync with ../spec/schemas/$name — run scripts/sync-schemas.sh"
exit 1
fi
done
echo "all schemas in sync"
- name: pytest
working-directory: sdk-python
run: pytest -ra --tb=short
- name: ruff
working-directory: sdk-python
run: ruff check openagp tests
build:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install --upgrade pip build twine
- run: python -m build
- run: twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/