-
Notifications
You must be signed in to change notification settings - Fork 5
114 lines (94 loc) · 3.54 KB
/
run-tests.yml
File metadata and controls
114 lines (94 loc) · 3.54 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
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Run Tests
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
workflow_dispatch: # Allows manual triggering
jobs:
test:
needs: license-check
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required: hatch-vcs needs full tag history
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y graphviz libgraphviz-dev
- name: Install dependencies
run: uv sync --locked --all-extras --dev
- name: Run tests
run: uv run pytest -v -m "not postgres" --cov=src --cov-report=term-missing --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
spiral-integration:
runs-on: ubuntu-latest
# Only run on push/manual trigger — not on PRs — to avoid consuming SpiralDB
# resources on every review cycle.
# Requires SPIRAL_WORKLOAD_ID secret to be configured; skips gracefully if absent.
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: test
permissions:
id-token: write # required to request a GitHub OIDC token for SpiralDB auth
contents: read
env:
SPIRAL_WORKLOAD_ID: ${{ secrets.SPIRAL_WORKLOAD_ID }}
SPIRAL_INTEGRATION_TESTS: "1"
SPIRAL_PROJECT_ID: ${{ vars.SPIRAL_PROJECT_ID || 'test-orcapod-362211' }}
SPIRAL_SERVER_URL: ${{ vars.SPIRAL_SERVER_URL || 'http://api.spiraldb.dev' }}
steps:
- name: Check for SPIRAL_WORKLOAD_ID
if: env.SPIRAL_WORKLOAD_ID == ''
run: |
echo "::notice::SPIRAL_WORKLOAD_ID not set — skipping SpiralDB integration tests"
exit 0
- uses: actions/checkout@v4
if: env.SPIRAL_WORKLOAD_ID != ''
with:
fetch-depth: 0 # required: hatch-vcs needs full tag history
- name: Install uv
if: env.SPIRAL_WORKLOAD_ID != ''
uses: astral-sh/setup-uv@v5
- name: Set up Python 3.11
if: env.SPIRAL_WORKLOAD_ID != ''
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install system dependencies
if: env.SPIRAL_WORKLOAD_ID != ''
run: sudo apt-get update && sudo apt-get install -y graphviz libgraphviz-dev
- name: Install dependencies
if: env.SPIRAL_WORKLOAD_ID != ''
run: uv sync --locked --all-extras --dev
- name: Run SpiralDB integration tests
if: env.SPIRAL_WORKLOAD_ID != ''
run: uv run pytest tests/test_databases/test_spiraldb_connector_integration.py -v
license-check:
uses: ./.github/workflows/_license-check.yml
dependency-review:
name: Dependency review
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Dependency review
uses: actions/dependency-review-action@v4
with:
deny-licenses: >-
GPL-2.0-only, GPL-2.0-or-later,
GPL-3.0-only, GPL-3.0-or-later,
AGPL-3.0-only, AGPL-3.0-or-later,
LGPL-2.0-only, LGPL-2.0-or-later,
LGPL-2.1-only, LGPL-2.1-or-later,
LGPL-3.0-only, LGPL-3.0-or-later