Repository navigation
123 lines (101 loc) · 4.89 KB
/
Copy pathrun-tests.yml
File metadata and controls
123 lines (101 loc) · 4.89 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
115
116
117
118
119
120
121
122
123
name: Run Tests
on:
push:
branches: [main, dev, extension-type-system]
pull_request:
workflow_dispatch: # Allows manual triggering
jobs:
test:
needs: license-check
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0 # required: hatch-vcs needs full tag history
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y graphviz
- name: Install dependencies
run: uv sync --locked --all-extras --dev --python ${{ matrix.python-version }}
- name: Check golden files against release tags
# Every golden file and pin a release tag of the current data context shipped must
# be unchanged in HEAD (ITL-946). Fails when git, the history or the tags are missing.
run: uv run --python ${{ matrix.python-version }} python scripts/check_golden_tags.py
- name: Run tests
run: uv run --python ${{ matrix.python-version }} pytest -v -rsxX --durations=20 -m "not postgres" --cov=src --cov-report=term-missing --cov-report=xml
- name: Upload coverage reports to Codecov
if: github.repository == 'metamorphic-labs/orcapod-python'
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
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 the SPIRAL_WORKLOAD_ID secret and the SPIRAL_PROJECT_ID repository variable;
# fails loudly if either is absent so missing settings don't silently drop coverage. Runs only on the development repository:
# the public repository has no SpiralDB credentials, so the job is skipped there (ITL-1007).
if: >-
github.repository == 'metamorphic-labs/orcapod-python'
&& (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 }}
SPIRAL_SERVER_URL: https://api.spiraldb.dev # plain http no longer answers (ITL-1008); the repository variable of this name is not read
steps:
- name: Check for SPIRAL_WORKLOAD_ID
if: env.SPIRAL_WORKLOAD_ID == ''
run: |
echo "::error::SPIRAL_WORKLOAD_ID secret is not set. SpiralDB integration tests cannot run. Configure the secret or investigate why it is missing."
exit 1
- name: Check for SPIRAL_PROJECT_ID
if: env.SPIRAL_PROJECT_ID == ''
run: |
echo "::error::SPIRAL_PROJECT_ID repository variable is not set. SpiralDB integration tests cannot run. Configure the variable or investigate why it is missing."
exit 1
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0 # required: hatch-vcs needs full tag history
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- name: Set up Python 3.11
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.11"
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y graphviz
- name: Install dependencies
run: uv sync --locked --all-extras --dev --python "3.11"
- name: Run SpiralDB integration tests
run: uv run --python "3.11" 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Dependency review
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
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