-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 2 KB
/
tests.yml
File metadata and controls
68 lines (57 loc) · 2 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
name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Detect changes
id: changes
uses: dorny/paths-filter@v3
with:
filters: |
v1:
- 'tools/v1_sync_pipeline/**'
- 'docs/v1/**'
v2:
- 'tools/v2_sync_pipeline/**'
- 'docs/v2/**'
workflows:
- '.github/workflows/**'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.4'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-ci.txt
- name: Ensure v1 sync script is idempotent
if: steps.changes.outputs.v1 == 'true' || steps.changes.outputs.workflows == 'true'
run: |
python tools/v1_sync_pipeline/sync_v1_docs.py --fail-on-diff --summary-file "$GITHUB_STEP_SUMMARY"
python tools/v1_sync_pipeline/qa/check_links.py docs/v1/affinity_api_docs.md
- name: Ensure v2 sync script is idempotent
if: steps.changes.outputs.v2 == 'true' || steps.changes.outputs.workflows == 'true'
run: |
python tools/v2_sync_pipeline/sync_v2_docs.py --fail-on-diff --snapshot-dir tmp/v2
python tools/v1_sync_pipeline/qa/check_links.py docs/v2/affinity_api_docs.md
- name: Run unit tests
run: |
pytest tests/ -m "not integration" -v --tb=short
- name: Run tests with coverage
run: |
pytest tests/ -m "not integration" --cov=tools/v1_sync_pipeline --cov=tools/v2_sync_pipeline --cov-report=term-missing --cov-report=xml
- name: Upload coverage reports
if: always()
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false