-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 2.07 KB
/
ci.yml
File metadata and controls
62 lines (52 loc) · 2.07 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
name: CI
permissions:
contents: read
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
name: Test on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Pin CI to a single, consistent Python version to reduce version-related
# test flakiness. Use 3.12 for CI stability; expand matrix later if desired.
python-version: ["3.12"]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Checkout apcore-cli spec repo (conformance fixtures)
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: aiperceivable/apcore-cli
path: .apcore-cli-spec
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v5
# `--extra dev` pulls pytest, ruff, pre-commit, mypy, apdev; `--extra toolkit`
# brings in apcore-toolkit >= 0.5.0. apcore >= 0.19.0 comes from the main
# `dependencies` section and is installed unconditionally. Toolkit must be
# importable for tests/test_toolkit_integration.py (which uses
# `patch("apcore_toolkit.BindingLoader", ...)` — patch resolves the target
# at import time and fails if the module is absent).
- name: Install dependencies (apcore, apcore-toolkit, dev extras)
run: |
uv sync --extra dev --extra toolkit
# Single pre-commit invocation covers ruff lint + ruff-format + apdev
# (check-chars, check-imports). Matches the TypeScript CI pattern at
# ../apcore-cli-typescript/.github/workflows/ci.yml which likewise runs
# `pre-commit run --all-files` as the lint gate.
- name: Run pre-commit (ruff + apdev hooks)
run: |
uv run pre-commit run --all-files
- name: Run tests
env:
APCORE_CLI_SPEC_REPO: ${{ github.workspace }}/.apcore-cli-spec
run: |
uv run pytest