Repository navigation
98 lines (90 loc) · 3.44 KB
/
Copy pathci.yml
File metadata and controls
98 lines (90 loc) · 3.44 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
# Lint, type-check, unit tests and the SDK conformance suite on every push and pull
# request. This workflow builds the package to check that it builds; it never publishes.
#
# The conformance suite is checked out from the public repository
# Bynn-Intelligence/decision-node-conformance, with no token, at the commit pinned in
# CONFORMANCE_REF below. The test run starts the
# suite's mock server and runs every case; it fails when the suite is missing.
#
# Supply chain: every action is pinned to a commit SHA (the release tag is in the
# comment), every checkout sets persist-credentials: false, and uv is installed at a
# pinned version.
name: CI
on:
push:
pull_request:
permissions:
contents: read
env:
# The conformance suite commit this SDK is tested against (suite 1.27, tag v1.27, for specification
# 1.4). Change it here only.
CONFORMANCE_REF: e35c3fa8a7b164c9f68d4fc245ebba8b4d8a1d04
UV_VERSION: "0.7.13"
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"
- run: python -m pip install "uv==${{ env.UV_VERSION }}"
- run: uv sync --locked
- run: uv run ruff check .
- run: uv run ruff format --check .
- run: uv run mypy
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
persist-credentials: false
- name: Check out the conformance suite
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
repository: Bynn-Intelligence/decision-node-conformance
ref: ${{ env.CONFORMANCE_REF }}
path: conformance
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install "uv==${{ env.UV_VERSION }}"
- run: uv sync --locked --python "${{ matrix.python-version }}"
# The conformance tests start the suite's mock server (mock/server.py) and run
# every case of every kind, with both clients.
- name: Unit tests and the whole conformance suite
env:
DECISIONNODE_CONFORMANCE_DIR: ${{ github.workspace }}/conformance
run: uv run pytest -ra
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"
- run: python -m pip install "uv==${{ env.UV_VERSION }}"
- run: uv build
# The check that runs before every release, tested with invented words; it
# needs no secret.
name-check:
name: Release name check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
persist-credentials: false
- name: Test the release name check
run: python3 .github/scripts/test_check_names.py