-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (67 loc) · 1.98 KB
/
CI.yml
File metadata and controls
79 lines (67 loc) · 1.98 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
name: CI/CD Pipeline
on:
push:
branches:
- "**"
paths:
- "**"
permissions:
checks: write
contents: read
pull-requests: read
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Set up environment
run: |
uv venv
uv sync
- name: Get Python path
run: |
PYTHON_BIN="$(uv run python -c 'import sys; print(sys.executable)')"
echo "PYTHON_BIN=$PYTHON_BIN" >> $GITHUB_ENV
- name: Run Pyright
uses: jakebailey/pyright-action@v2
with:
python-path: ${{ env.PYTHON_BIN }}
pylance-version: latest-release
- name: Run Unit Tests with JUnit XML output
run: uv run pytest tests/ --cov=src/amrita_sense --cov-report=term-missing --cov-report=xml --junitxml=test-results.xml -v
- name: Publish Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Python Unit Tests
path: test-results.xml
reporter: java-junit
fail-on-error: false
- name: Check code format
uses: astral-sh/ruff-action@v3
with:
args: check . --exit-non-zero-on-fix
- name: Build package
run: uv build
all-matrix-jobs-passed:
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- name: Verify all matrix jobs succeeded
run: |
if [ "${{ needs.build.result }}" != "success" ]; then
echo "❌ Some matrix jobs of 'build' failed or were cancelled."
exit 1
fi
echo "✅ All matrix jobs passed!"