-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 1.59 KB
/
contract.yml
File metadata and controls
49 lines (47 loc) · 1.59 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
name: Contract tests
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 6 * * *' # daily at 06:00 UTC
repository_dispatch:
types: [openapi-updated]
jobs:
contract:
name: validate parser against latest audd-openapi fixtures
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: audd-python
- name: Check out audd-openapi
uses: actions/checkout@v4
with:
repository: AudDMusic/audd-openapi
path: audd-openapi
ref: main
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
cache-dependency-path: audd-python/pyproject.toml
- name: Install
working-directory: audd-python
run: pip install -e '.[dev]'
- name: Run contract tests
working-directory: audd-python
env:
AUDD_OPENAPI_FIXTURES: ${{ github.workspace }}/audd-openapi/fixtures
run: python -m pytest tests/contract/ -v --tb=short
- name: Open issue on failure (dispatched runs only)
if: failure() && github.event_name == 'repository_dispatch'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TRIGGER_SHA: ${{ github.event.client_payload.trigger_sha }}
run: |
gh issue create \
--title "Contract drift: audd-openapi spec change broke parser" \
--body "An openapi-updated dispatch (trigger SHA: $TRIGGER_SHA) caused contract tests to fail. Investigate and update parsers." \
--label "contract-drift" || true