Skip to content

Commit b6e9444

Browse files
nficanoclaude
andcommitted
ci: add GitHub Actions test workflow
Runs unit tests on push to main and PRs, with caching, concurrency control, minimal permissions, and pinned action versions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 84946d8 commit b6e9444

1 file changed

Lines changed: 85 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# CI for the ARCP Python SDK.
2+
#
3+
# Action pinning policy:
4+
# - First-party `actions/*` actions are pinned to a major tag (e.g. `@v4`).
5+
# GitHub controls these repos and major tags only move forward to
6+
# non-breaking releases.
7+
# - Third-party actions are pinned to a full commit SHA with the human-
8+
# readable version in a trailing comment.
9+
name: test
10+
11+
on:
12+
push:
13+
branches: [main]
14+
paths-ignore:
15+
- "**.md"
16+
- "docs/**"
17+
- "LICENSE"
18+
- ".gitignore"
19+
- ".editorconfig"
20+
pull_request:
21+
branches: [main]
22+
paths-ignore:
23+
- "**.md"
24+
- "docs/**"
25+
- "LICENSE"
26+
- ".gitignore"
27+
- ".editorconfig"
28+
workflow_dispatch:
29+
30+
concurrency:
31+
group: ${{ github.workflow }}-${{ github.ref }}
32+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
33+
34+
permissions:
35+
contents: read
36+
37+
jobs:
38+
test:
39+
name: test (py${{ matrix.python-version }})
40+
runs-on: ubuntu-latest
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
# `requires-python = ">=3.13"` in pyproject.toml.
45+
# Floor + latest stable. 3.13 is currently both, 3.14 is the next stable.
46+
python-version: ["3.13", "3.14"]
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
with:
51+
fetch-depth: 1
52+
53+
- name: Install uv
54+
uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.10.0
55+
with:
56+
enable-cache: true
57+
cache-dependency-glob: "uv.lock"
58+
59+
- name: Set up Python ${{ matrix.python-version }}
60+
uses: actions/setup-python@v5
61+
with:
62+
python-version: ${{ matrix.python-version }}
63+
64+
- name: Install project
65+
run: uv sync --frozen --all-extras --dev
66+
67+
- name: Ruff lint
68+
run: uv run ruff check .
69+
70+
- name: Ruff format check
71+
run: uv run ruff format --check .
72+
73+
- name: Pyright
74+
run: uv run pyright
75+
76+
- name: Pytest
77+
run: uv run pytest --junitxml=junit-${{ matrix.python-version }}.xml
78+
79+
- name: Upload junit XML on failure
80+
if: failure()
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: junit-${{ matrix.python-version }}
84+
path: junit-${{ matrix.python-version }}.xml
85+
if-no-files-found: ignore

0 commit comments

Comments
 (0)