-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (63 loc) · 2.72 KB
/
Copy pathci.yml
File metadata and controls
65 lines (63 loc) · 2.72 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
name: CI
on:
push:
branches: [main]
pull_request:
schedule:
# Mondays 06:00 UTC -- surface OpenAPI drift even without a push. Only does
# anything once the SENDLY_OPENAPI_URL repository variable is set; see the
# drift step at the end of this file.
- cron: "0 6 * * 1"
# Public repo -> GitHub-hosted standard runners (free for public repos).
# The org's self-hosted Warp runner group (warp-ubuntu-latest-*) is deliberately
# NOT used here: it may not be authorized for this repository, and the standard
# ubuntu-latest runners are sufficient for a pure-Python package.
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.13"]
steps:
- uses: actions/checkout@v6.0.3
- uses: actions/setup-python@v5.6.0
with:
python-version: ${{ matrix.python-version }}
- name: Install package with dev dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Ruff lint
run: ruff check .
- name: Ruff format check
run: ruff format --check .
- name: Mypy (strict)
run: mypy src
- name: Contract tests (SDK surface vs vendored OpenAPI)
run: pytest tests/test_contract.py
- name: Pytest
run: pytest
# Non-blocking: diff the vendored spec against the reference contract so
# drift shows up as a warning annotation without failing the build. Runs
# once (on the newest interpreter) to avoid duplicate reads and annotations.
#
# This step previously fetched https://api.sendly.now on every push, every
# pull request (forks included) and every weekly cron. Syncing the SDK spec
# from production is forbidden, so the source is now explicit: the step
# compares against whatever the SENDLY_OPENAPI_URL repository variable
# names, and SKIPS with a notice when that variable is unset. Until a
# maintainer sets it to a non-production contract, this step and the weekly
# schedule above are inert by design.
- name: OpenAPI drift check (non-blocking)
id: spec_drift
if: matrix.python-version == '3.13'
continue-on-error: true
env:
SENDLY_OPENAPI_URL: ${{ vars.SENDLY_OPENAPI_URL }}
run: python scripts/sync_spec.py --check
- name: Annotate OpenAPI drift
if: matrix.python-version == '3.13' && steps.spec_drift.outcome == 'failure'
run: |
echo "::warning title=OpenAPI spec drift::Vendored tests/fixtures/openapi.json differs from the contract at \$SENDLY_OPENAPI_URL. Run 'SENDLY_OPENAPI_URL=... python scripts/sync_spec.py' and commit the refreshed copy."