-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (85 loc) · 2.63 KB
/
Copy pathtests.yml
File metadata and controls
101 lines (85 loc) · 2.63 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
99
100
101
name: Tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
python:
name: python (${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install with dev extras
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
- name: Run ruff
run: python -m ruff check sidecar/
- name: Guard — ANTHROPIC_API_KEY must NOT be set for default suite
run: |
if [ -n "${ANTHROPIC_API_KEY:-}" ]; then
echo "::error::ANTHROPIC_API_KEY is set in the default test environment."
echo "This can cause non-'live'-marked tests to leak real API calls."
echo "Either unset the key, or mark the test with @pytest.mark.live."
exit 1
fi
shell: bash
- name: Run tests (with coverage on py3.11)
run: |
if [ "${{ matrix.python-version }}" = "3.11" ]; then
python -m pytest sidecar/tests/ -v --tb=short --cov --cov-report=term-missing --cov-report=xml
else
python -m pytest sidecar/tests/ -v --tb=short
fi
shell: bash
- name: Upload coverage artifact
if: matrix.python-version == '3.11'
uses: actions/upload-artifact@v4
with:
name: coverage-attune-gui
path: coverage.xml
- name: Upload coverage to Codecov
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
with:
files: ./coverage.xml
fail_ci_if_error: false
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
frontend:
name: frontend (Vitest)
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: editor-frontend
steps:
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: editor-frontend/package-lock.json
- name: Install
run: npm ci
- name: Typecheck
run: npm run typecheck
- name: Lint
run: npm run lint
- name: Vitest unit tests
run: npm run test