-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (77 loc) · 2.56 KB
/
Copy pathci.yml
File metadata and controls
94 lines (77 loc) · 2.56 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
name: CI
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-package:
name: ${{ matrix.os }} / Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-15
- windows-latest
python-version:
- "3.10"
- "3.14"
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PYTHONUTF8: "1"
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install package and development tools
run: python -m pip install -e ".[dev]"
- name: Check formatting
run: python -m ruff format --check src tests
- name: Lint
run: python -m ruff check src tests
- name: Type-check
run: python -m mypy
- name: Test
run: python -m pytest --cov=annotateit_ai --cov-report=term-missing
- name: Build source and wheel distributions
run: python -m build
- name: Check distribution metadata
run: |
python -m twine check --strict dist/*
python scripts/verify-distributions.py dist
- name: Create isolated wheel smoke-test environment
run: python -m venv .wheel-smoke
- name: Smoke-test wheel on Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
$wheels = @(Get-ChildItem -LiteralPath dist -Filter *.whl)
if ($wheels.Count -ne 1) { throw "Expected exactly one wheel, found $($wheels.Count)." }
.\.wheel-smoke\Scripts\python.exe -m pip install $wheels[0].FullName
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
.\.wheel-smoke\Scripts\annotateit.exe --help
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Smoke-test wheel on macOS and Ubuntu
if: runner.os != 'Windows'
shell: bash
run: |
shopt -s nullglob
wheels=(dist/*.whl)
if (( ${#wheels[@]} != 1 )); then
echo "Expected exactly one wheel, found ${#wheels[@]}." >&2
exit 1
fi
.wheel-smoke/bin/python -m pip install "${wheels[0]}"
.wheel-smoke/bin/annotateit --help