Skip to content

Commit f942a24

Browse files
committed
ci: merge-queue support and a leaner pipeline
With golden fixtures no longer drifting across three formats on every change, the pipeline can run the full test set on every build and a rebasing merge queue becomes practical: the queue can rebase a PR onto the current tip and re-test it without the expected outputs churning. All actions are also bumped to their latest releases (cpp-actions to v1.9.5 and the GitHub-maintained actions to their node24 versions) so the runner no longer warns about the deprecated node20 runtime.
1 parent 57174d9 commit f942a24

9 files changed

Lines changed: 63 additions & 55 deletions

File tree

.github/workflows/ci-build.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,29 @@ jobs:
3535
env: ${{ matrix.env }}
3636
steps:
3737
- name: Container Bootstrap
38-
uses: alandefreitas/cpp-actions/container-bootstrap@v1.9.4
38+
uses: alandefreitas/cpp-actions/container-bootstrap@v1.9.5
3939

4040
- name: Setup C++
41-
uses: alandefreitas/cpp-actions/setup-cpp@v1.9.4
41+
uses: alandefreitas/cpp-actions/setup-cpp@v1.9.5
4242
id: setup-cpp
4343
with:
4444
compiler: ${{ matrix.compiler }}
4545
version: ${{ matrix.version }}
4646

4747
- name: Install System Packages
48-
uses: alandefreitas/cpp-actions/package-install@v1.9.4
48+
uses: alandefreitas/cpp-actions/package-install@v1.9.5
4949
id: package-install
5050
with:
5151
packages: ${{ matrix.install }}
5252
apt-get-source-keys: ${{ matrix.coverage && 'https://apt.llvm.org/llvm-snapshot.gpg.key' || '' }}
5353
apt-get-sources: ${{ matrix.coverage && 'deb https://apt.llvm.org/noble/ llvm-toolchain-noble-21 main' || '' }}
5454

5555
- name: Clone MrDocs
56-
uses: actions/checkout@v4
56+
uses: actions/checkout@v6
5757

5858
- name: Restore LLVM Cache
5959
id: llvm-cache
60-
uses: actions/cache/restore@v4
60+
uses: actions/cache/restore@v5
6161
with:
6262
path: build/third-party/install/llvm
6363
key: ${{ matrix.llvm-cache-key }}
@@ -111,13 +111,13 @@ jobs:
111111
contains(env.BOOTSTRAP_REBUILT, 'llvm')
112112
&& (github.event_name != 'pull_request'
113113
|| github.event.pull_request.head.repo.full_name == github.repository)
114-
uses: actions/cache/save@v4
114+
uses: actions/cache/save@v5
115115
with:
116116
path: build/third-party/install/llvm
117117
key: ${{ matrix.llvm-cache-key }}
118118

119119
- name: CMake Workflow
120-
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.4
120+
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.5
121121
with:
122122
cmake-version: '>=3.26'
123123
cxxstd: ${{ matrix.cxxstd }}
@@ -129,7 +129,6 @@ jobs:
129129
generator: Ninja
130130
build-type: ${{ matrix.build-type }}
131131
install-prefix: .local
132-
extra-args: -D MRDOCS_EXPENSIVE_TESTS=${{ matrix.is-bottleneck && 'OFF' || 'ON' }}
133132
export-compile-commands: true
134133
run-tests: true
135134
install: true
@@ -142,7 +141,7 @@ jobs:
142141
# Upload packages for ci-releases.yml to pick up
143142
- name: Upload GitHub Release Artifacts
144143
if: matrix.is-release-build == 'true'
145-
uses: actions/upload-artifact@v4
144+
uses: actions/upload-artifact@v7
146145
with:
147146
name: ${{ matrix.mrdocs-release-package-artifact }}
148147
path: |
@@ -151,7 +150,7 @@ jobs:
151150
retention-days: 1
152151

153152
- name: FlameGraph
154-
uses: alandefreitas/cpp-actions/flamegraph@v1.9.4
153+
uses: alandefreitas/cpp-actions/flamegraph@v1.9.5
155154
if: matrix.time-trace
156155
with:
157156
build-dir: build
@@ -160,7 +159,7 @@ jobs:
160159
- name: Process Coverage
161160
id: process-coverage
162161
if: matrix.coverage
163-
uses: alandefreitas/cpp-actions/process-coverage@v1.9.4
162+
uses: alandefreitas/cpp-actions/process-coverage@v1.9.5
164163
with:
165164
cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }}
166165
build-dir: build
@@ -177,7 +176,7 @@ jobs:
177176
github.event_name == 'push' &&
178177
github.ref_name == 'develop' &&
179178
steps.process-coverage.outputs.lcov-file != ''
180-
uses: actions/upload-artifact@v4
179+
uses: actions/upload-artifact@v7
181180
with:
182181
name: coverage-develop
183182
path: ${{ steps.process-coverage.outputs.lcov-file }}

.github/workflows/ci-documentation.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,25 @@ jobs:
4545
contents: read
4646
steps:
4747
- name: Container Bootstrap
48-
uses: alandefreitas/cpp-actions/container-bootstrap@v1.9.4
48+
uses: alandefreitas/cpp-actions/container-bootstrap@v1.9.5
4949

5050
- name: Install packages
51-
uses: alandefreitas/cpp-actions/package-install@v1.9.4
51+
uses: alandefreitas/cpp-actions/package-install@v1.9.5
5252
with:
5353
apt-get: build-essential asciidoctor cmake bzip2 git rsync
5454

5555
- name: Clone MrDocs
56-
uses: actions/checkout@v4
56+
uses: actions/checkout@v6
5757
with:
5858
fetch-depth: 1
5959

6060
- name: Install Node.js
61-
uses: actions/setup-node@v4
61+
uses: actions/setup-node@v6
6262
with:
6363
node-version: '20'
6464

6565
- name: Setup C++
66-
uses: alandefreitas/cpp-actions/setup-cpp@v1.9.4
66+
uses: alandefreitas/cpp-actions/setup-cpp@v1.9.5
6767
id: setup-cpp
6868
with:
6969
compiler: ${{ matrix.compiler }}
@@ -73,7 +73,7 @@ jobs:
7373
# when we built this run, develop-release fallback otherwise.
7474
- name: Download MrDocs package (fresh build)
7575
if: ${{ !inputs.use-develop-binaries }}
76-
uses: actions/download-artifact@v4
76+
uses: actions/download-artifact@v8
7777
with:
7878
name: ${{ matrix.mrdocs-release-package-artifact }}
7979
path: packages
@@ -128,7 +128,7 @@ jobs:
128128
cp -vr build/site/* ../build/docs-local
129129
130130
- name: Upload Website as Artifact
131-
uses: actions/upload-artifact@v4
131+
uses: actions/upload-artifact@v7
132132
with:
133133
name: Website ${{ runner.os }}
134134
path: build/website

.github/workflows/ci-matrix.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
submatrices: ${{ steps.cpp-matrix.outputs.submatrices }}
3232
steps:
3333
- name: Generate Test Matrix
34-
uses: alandefreitas/cpp-actions/cpp-matrix@v1.9.4
34+
uses: alandefreitas/cpp-actions/cpp-matrix@v1.9.5
3535
id: cpp-matrix
3636
with:
3737
compilers: |
@@ -110,14 +110,10 @@ jobs:
110110
mrdocs-package-generators: {{select (ieq os 'windows') "7Z ZIP WIX" "TGZ TXZ"}}
111111
mrdocs-release-package-artifact: release-packages-{{{ lowercase os }}}
112112
113-
# Bottleneck builds: skip expensive tests that ended up being redundant to save CI time
114-
is-bottleneck: {{#if (or msan (and (ieq compiler 'apple-clang') (or asan ubsan))) }}true{{/if}}
115-
116113
submatrices: |
117114
releases: {{ieq is-release-build 'true'}}
118115
# `coverage` is a raw boolean factor (undefined on non-Coverage rows),
119-
# so `ieq` would crash. Wrap in `#if` like the `is-bottleneck` extra-value
120-
# above to handle undefined cleanly.
116+
# so `ieq` would crash. Wrap in `#if` to handle the undefined case cleanly.
121117
coverage: {{#if coverage}}true{{/if}}
122118
releases-and-coverage: {{#if (or (ieq is-release-build 'true') coverage)}}true{{/if}}
123119
trace-commands: true

.github/workflows/ci-publish.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,41 +87,41 @@ jobs:
8787
8888
- name: Install packages
8989
if: inputs.should-publish
90-
uses: alandefreitas/cpp-actions/package-install@v1.9.4
90+
uses: alandefreitas/cpp-actions/package-install@v1.9.5
9191
with:
9292
apt-get: rsync git
9393

9494
- name: Clone MrDocs
9595
if: inputs.should-publish
96-
uses: actions/checkout@v4
96+
uses: actions/checkout@v6
9797
with:
9898
fetch-depth: 0
9999
fetch-tags: true
100100

101101
- name: Install Node.js
102102
if: inputs.should-publish
103-
uses: actions/setup-node@v4
103+
uses: actions/setup-node@v6
104104
with:
105105
node-version: '20'
106106

107107
- name: Download all platform packages
108108
if: inputs.should-publish
109-
uses: actions/download-artifact@v4
109+
uses: actions/download-artifact@v8
110110
with:
111111
pattern: release-packages-*
112112
path: packages
113113
merge-multiple: true
114114

115115
- name: Download website (Linux)
116116
if: inputs.should-publish
117-
uses: actions/download-artifact@v4
117+
uses: actions/download-artifact@v8
118118
with:
119119
name: Website Linux
120120
path: build/website
121121

122122
- name: Download demos (Linux)
123123
if: inputs.should-publish
124-
uses: actions/download-artifact@v4
124+
uses: actions/download-artifact@v8
125125
with:
126126
name: demos${{ (contains(fromJSON('["master", "develop"]'), github.ref_name) && format('-{0}', github.ref_name)) || '' }}-Linux
127127
path: .
@@ -175,7 +175,7 @@ jobs:
175175
- name: Download previous demos (tags only)
176176
if: inputs.should-publish && startsWith(github.ref, 'refs/tags/')
177177
id: download-prev-demos
178-
uses: actions/download-artifact@v4
178+
uses: actions/download-artifact@v8
179179
continue-on-error: true
180180
with:
181181
name: demos-develop-Linux
@@ -188,15 +188,15 @@ jobs:
188188

189189
- name: Upload demo diff (tags only)
190190
if: inputs.should-publish && startsWith(github.ref, 'refs/tags/') && steps.compare-demos.outputs.diff == 'true'
191-
uses: actions/upload-artifact@v4
191+
uses: actions/upload-artifact@v7
192192
with:
193193
name: demos-diff
194194
path: demos-diff
195195
retention-days: 30
196196

197197
- name: Publish website to GitHub Pages
198198
if: inputs.should-publish
199-
uses: peaceiris/actions-gh-pages@v3
199+
uses: peaceiris/actions-gh-pages@v4
200200
with:
201201
github_token: ${{ secrets.GITHUB_TOKEN }}
202202
publish_dir: build/website
@@ -225,7 +225,7 @@ jobs:
225225
226226
- name: Create changelog
227227
if: inputs.should-publish
228-
uses: alandefreitas/cpp-actions/create-changelog@v1.9.4
228+
uses: alandefreitas/cpp-actions/create-changelog@v1.9.5
229229
with:
230230
output-path: CHANGELOG.md
231231
thank-non-regular: ${{ startsWith(github.ref, 'refs/tags/') }}
@@ -251,7 +251,7 @@ jobs:
251251
252252
- name: Create consolidated GitHub Release
253253
if: inputs.should-publish
254-
uses: softprops/action-gh-release@v2
254+
uses: softprops/action-gh-release@v3
255255
with:
256256
files: packages/MrDocs-*-*.*
257257
fail_on_unmatched_files: true

.github/workflows/ci-releases.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,29 +44,29 @@ jobs:
4444
contents: read
4545
steps:
4646
- name: Container Bootstrap
47-
uses: alandefreitas/cpp-actions/container-bootstrap@v1.9.4
47+
uses: alandefreitas/cpp-actions/container-bootstrap@v1.9.5
4848

4949
- name: Install packages
50-
uses: alandefreitas/cpp-actions/package-install@v1.9.4
50+
uses: alandefreitas/cpp-actions/package-install@v1.9.5
5151
with:
5252
apt-get: build-essential asciidoctor cmake bzip2 git rsync
5353

5454
- name: Clone MrDocs
55-
uses: actions/checkout@v4
55+
uses: actions/checkout@v6
5656
with:
5757
fetch-depth: 1
5858

5959
- name: Install Node.js
60-
uses: actions/setup-node@v4
60+
uses: actions/setup-node@v6
6161
with:
6262
node-version: '20'
6363

6464
- name: Setup Ninja
6565
if: runner.os == 'Windows'
66-
uses: seanmiddleditch/gha-setup-ninja@v5
66+
uses: seanmiddleditch/gha-setup-ninja@v6
6767

6868
- name: Setup C++
69-
uses: alandefreitas/cpp-actions/setup-cpp@v1.9.4
69+
uses: alandefreitas/cpp-actions/setup-cpp@v1.9.5
7070
id: setup-cpp
7171
with:
7272
compiler: ${{ matrix.compiler }}
@@ -78,7 +78,7 @@ jobs:
7878
# this when it verified the cache is warm.
7979
- name: Download MrDocs package (fresh build)
8080
if: ${{ !inputs.use-develop-binaries }}
81-
uses: actions/download-artifact@v4
81+
uses: actions/download-artifact@v8
8282
with:
8383
name: ${{ matrix.mrdocs-release-package-artifact }}
8484
path: packages
@@ -102,7 +102,7 @@ jobs:
102102
run: .github/scripts/install-mrdocs-package.sh
103103

104104
- name: Clone Boost.URL
105-
uses: alandefreitas/cpp-actions/boost-clone@v1.9.4
105+
uses: alandefreitas/cpp-actions/boost-clone@v1.9.5
106106
with:
107107
branch: develop
108108
modules: url
@@ -112,28 +112,28 @@ jobs:
112112
trace-commands: true
113113

114114
- name: Clone Beman.Optional
115-
uses: actions/checkout@v4
115+
uses: actions/checkout@v6
116116
with:
117117
repository: steve-downey/optional
118118
ref: main
119119
path: beman-optional
120120

121121
- name: Clone Fmt
122-
uses: actions/checkout@v4
122+
uses: actions/checkout@v6
123123
with:
124124
repository: fmtlib/fmt
125125
ref: main
126126
path: fmt
127127

128128
- name: Clone Nlohmann.Json
129-
uses: actions/checkout@v4
129+
uses: actions/checkout@v6
130130
with:
131131
repository: nlohmann/json
132132
ref: develop
133133
path: nlohmann-json
134134

135135
- name: Clone MpUnits
136-
uses: actions/checkout@v4
136+
uses: actions/checkout@v6
137137
with:
138138
repository: mpusz/mp-units
139139
ref: master
@@ -155,7 +155,7 @@ jobs:
155155
run: .github/scripts/generate-demos.sh
156156

157157
- name: Upload Demos as Artifacts
158-
uses: actions/upload-artifact@v4
158+
uses: actions/upload-artifact@v7
159159
with:
160160
name: demos${{ (contains(fromJSON('["master", "develop"]'), github.ref_name) && format('-{0}', github.ref_name)) || '' }}-${{ runner.os }}
161161
path: demos.tar.gz

.github/workflows/ci-scope-detector.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ jobs:
8181

8282
steps:
8383
- name: Checkout
84-
uses: actions/checkout@v4
84+
uses: actions/checkout@v6
8585
with:
8686
fetch-depth: 0
8787

8888
- name: Setup Node.js
89-
uses: actions/setup-node@v4
89+
uses: actions/setup-node@v6
9090
with:
9191
node-version: '20'
9292

@@ -99,6 +99,7 @@ jobs:
9999
env:
100100
GITHUB_EVENT_NAME: ${{ github.event_name }}
101101
BASE_REF: ${{ github.base_ref }}
102+
MERGE_GROUP_BASE_SHA: ${{ github.event.merge_group.base_sha }}
102103
PR_BODY: ${{ github.event.pull_request.body }}
103104
PR_LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
104105
run: |
@@ -117,6 +118,14 @@ jobs:
117118
if [[ "$GITHUB_EVENT_NAME" == 'pull_request' ]]; then
118119
merge_base=$(git merge-base "origin/$BASE_REF" HEAD)
119120
git diff --name-only "$merge_base" HEAD > changed-files.txt
121+
elif [[ "$GITHUB_EVENT_NAME" == 'merge_group' ]]; then
122+
# The queue tests the speculative commit (HEAD = the queued PR(s)
123+
# rebased on top of everything ahead of them in the queue). Diff
124+
# against the base the group was cut from so the same code/non-code
125+
# scope rules apply here as on the PR itself: a code-touching queue
126+
# entry runs the full matrix, a docs-only one stays reduced.
127+
merge_base="$MERGE_GROUP_BASE_SHA"
128+
git diff --name-only "$merge_base" HEAD > changed-files.txt
120129
else
121130
merge_base="$(git rev-parse HEAD)"
122131
: > changed-files.txt

0 commit comments

Comments
 (0)