Repository navigation
96 lines (78 loc) · 2.95 KB
/
Copy pathci.yml
File metadata and controls
96 lines (78 loc) · 2.95 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
name: gate-knowledge CI
# Per SO1.5 + SO2.5:
# pull_request -> validation + broken-link + completeness audit (fast)
# push to main -> same as PR, plus full junit-XML artifact
# workflow_dispatch -> same as standard plus optional extended checks
#
# Concurrency: cancel in-progress PR runs on new commits to the same PR.
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
validate:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Node (for markdownlint-cli2)
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
- name: Cache npm
uses: actions/cache@v4
with:
path: ~/.npm
key: npm-${{ runner.os }}-markdownlint-cli2
- name: Install Python tooling
run: pip install -e .[dev]
- name: Install markdownlint-cli2
run: npm install -g markdownlint-cli2
- name: yamllint on completeness_audit.yaml
run: yamllint tools/completeness_audit.yaml
- name: markdownlint-cli2 on bundle markdown
run: markdownlint-cli2 '**/*.md' '!tools/tests/**' '!LICENSE' '!NOTICE'
continue-on-error: false
- name: validate.py - all 10 checks, strict
run: python3 tools/validate.py --bundle-root . --strict --format text
- name: validate.py - completeness audit
run: python3 tools/validate.py --bundle-root . --completeness-audit tools/completeness_audit.yaml --strict
- name: validate.py - JUnit XML for CI dashboard
if: always()
run: python3 tools/validate.py --bundle-root . --strict --format junit > validate-junit-${{ matrix.python-version }}.xml || true
- name: pytest validator unit tests
run: pytest tools/test_validate.py -v --no-header
- name: Upload JUnit XML
if: always()
uses: actions/upload-artifact@v4
with:
name: validate-junit-py${{ matrix.python-version }}
path: validate-junit-${{ matrix.python-version }}.xml
retention-days: 90
- name: Upload validation report
if: failure()
uses: actions/upload-artifact@v4
with:
name: validate-report-py${{ matrix.python-version }}
path: |
validate-junit-${{ matrix.python-version }}.xml
retention-days: 90