Repository navigation
118 lines (108 loc) · 4.7 KB
/
Copy pathverify-scripts.yml
File metadata and controls
118 lines (108 loc) · 4.7 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
# Verify the committed outputs of the repository's generation chain.
#
# The generated export lists, the feature blocks and the committed metadata are
# build inputs, so every generator runs in --check mode (regenerate into a
# scratch copy, compare byte for byte) on all three host platforms. The AST
# comes from clang++ itself (-ast-dump=json): the generator needs only the
# compiler driver pinned in .xlings.json (`llvm`), installed by xlings like the
# build toolchains, plus the MinGW sysroot under tools/_deps provisioned by
# fetch_mingw_sysroot.py. No libclang, no LLVM release archive.
#
# The generator cache under target/gen/exports-cache (bundle TUs, pruned-GMF
# verdicts, incremental-skip keys and gen_audit.py's linkage reports) is worth
# caching because a hit skips the AST dump of an unchanged library entirely.
#
# The nightly cache-drift check that proves that cache sound lives in
# check-script-cache-drift.yml.
name: Verify Generation Scripts
env:
XLINGS_VERSION: v2026.10.26.1
XLINGS_NON_INTERACTIVE: '1'
on:
push:
branches: [main]
paths:
- ".github/workflows/verify-scripts.yml"
- ".github/actions/setup-generator/**"
- "tools/**"
- "src/**"
- "patches/**"
- "generated/**"
- "upstream/boost/**"
- "port/**"
- "mcpp.toml"
- ".gitignore"
- ".gitattributes"
pull_request:
branches: [main]
paths:
- ".github/workflows/verify-scripts.yml"
- ".github/actions/setup-generator/**"
- "tools/**"
- "src/**"
- "patches/**"
- "generated/**"
- "upstream/boost/**"
- "port/**"
- "mcpp.toml"
- ".gitignore"
- ".gitattributes"
# The event is part of the group: a push to main must not cancel a run
# triggered by another event on main.
concurrency:
group: generated-${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
verify:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 240
env:
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
strategy:
fail-fast: false
matrix:
include:
# import_boost is platform-independent and intentionally owned by one
# leg, so an update does not trigger three large downloads.
- os: ubuntu-latest
check_import_boost: true
- os: windows-latest
check_import_boost: false
- os: macos-latest
check_import_boost: false
steps:
- name: Checkout full history
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up the generation toolchain
uses: ./.github/actions/setup-generator
# gen_exports.py caches bundle TUs, pruned-GMF verdicts and
# incremental-skip keys under target/gen/exports-cache, gen_audit.py
# its linkage reports. Every entry is self-validating (keyed on the
# generator, clang and flags, and valid only while every file clang
# read for it and the first-wins ownership it was computed under still
# hold), so restoring an older commit's
# cache yields misses rather than wrong output; the nightly cache-drift
# workflow checks exactly that. The salt in the key only bounds rollover: a
# generator or sysroot-pin change drops the restore prefix instead of
# mixing verdicts across engine changes.
- name: Cache generator export intermediates
uses: actions/cache@v6
with:
path: target/gen/exports-cache
key: exports-cache-v2-${{ runner.os }}-${{ runner.arch }}-llvm-${{ env.LLVM_VERSION }}-${{ hashFiles('tools/gen_exports.py', 'tools/ast_json.py', 'tools/boost_common.py', 'tools/export_policy.toml', 'tools/fetch_mingw_sysroot.py') }}-${{ github.sha }}
restore-keys: |
exports-cache-v2-${{ runner.os }}-${{ runner.arch }}-llvm-${{ env.LLVM_VERSION }}-${{ hashFiles('tools/gen_exports.py', 'tools/ast_json.py', 'tools/boost_common.py', 'tools/export_policy.toml', 'tools/fetch_mingw_sysroot.py') }}-
- name: Check the AST compiler and tool regressions
working-directory: tools
run: |
uv run --locked python -c "import ast_json as aj; v = aj.clang_release(); print('AST compiler: clang', v); assert v == '${{ env.LLVM_VERSION }}', v"
uv run --locked python -m unittest discover -s tests
- name: Verify generated outputs (including import_boost when changed)
if: matrix.check_import_boost
run: uv run --project tools --locked python tools/ci/verify_generated.py --import-boost-if-changed
- name: Verify generated outputs
if: ${{ !matrix.check_import_boost }}
run: uv run --project tools --locked python tools/ci/verify_generated.py