Skip to content

Commit 8b2c3e9

Browse files
committed
ci: align llvm-sanitizer-config with archive basename
1 parent d629173 commit 8b2c3e9

1 file changed

Lines changed: 70 additions & 29 deletions

File tree

.github/workflows/ci.yml

Lines changed: 70 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
uses: actions/checkout@v4
4545

4646
- name: Generate Test Matrix
47-
uses: alandefreitas/cpp-actions/cpp-matrix@v1.9.1
47+
uses: alandefreitas/cpp-actions/cpp-matrix@v1.9.2
4848
id: cpp-matrix
4949
with:
5050
compilers: |
@@ -74,19 +74,19 @@ jobs:
7474
clang: git build-essential pkg-config python3 curl unzip openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev g++-14=14.2.0-4ubuntu2~24.04
7575
msvc: ''
7676
extra-values: |
77-
use-libcxx: {{#if (and (ieq compiler 'clang') msan) }}true{{else}}false{{/if}}
77+
use-libcxx: {{#if (and (ieq compiler 'clang') (or msan asan)) }}true{{else}}false{{/if}}
7878
libcxx-runtimes: libcxx{{#if (ne compiler 'msvc')}};libcxxabi{{/if}}
7979
llvm-runtimes: {{#if (ine use-libcxx 'true') }}{{{ libcxx-runtimes }}}{{/if}}
8080
llvm-hash: dc4cef81d47c7bc4a3c4d58fbacf8a6359683fae
8181
llvm-build-preset-prefix: {{{lowercase build-type}}}
8282
llvm-build-preset-os: {{#if (ieq os 'windows') }}win{{else}}unix{{/if}}
83-
llvm-sanitizer: {{#if (eq compiler 'gcc')}}{{else if ubsan}}-UBSan{{else if asan}}-ASan{{else if msan}}-MSan{{/if}}
8483
llvm-build-preset: {{{ llvm-build-preset-prefix }}}-{{{ llvm-build-preset-os }}}
8584
llvm-os-key: {{#if container}}{{{ container }}}{{else}}{{{ runs-on }}}{{/if}}
86-
llvm-archive-basename: {{#if msan}}llvm-{{{ substr llvm-hash 0 7 }}}-{{{ llvm-build-preset-prefix }}}-{{{ llvm-os-key }}}-{{{ compiler }}}-{{{ version }}}-MSan{{else}}llvm-{{{ substr llvm-hash 0 7 }}}-{{{ llvm-build-preset-prefix }}}-{{{ llvm-os-key }}}{{/if}}
85+
llvm-archive-sanitizer-str: {{#if (ieq compiler 'clang')}}{{#if ubsan}}UBSan{{else if asan}}ASan{{/if}}{{/if}}
86+
llvm-archive-basename: llvm-{{{ substr llvm-hash 0 7 }}}-{{{ llvm-build-preset-prefix }}}-{{{ llvm-os-key }}}{{#if (and (ieq compiler 'clang') (or msan asan)) }}-{{{ compiler }}}-{{{ version }}}-{{{ llvm-archive-sanitizer-str }}}{{/if}}
8787
llvm-archive-extension: {{#if (ieq os 'windows') }}7z{{else}}tar.bz2{{/if}}
8888
llvm-archive-filename: {{{ llvm-archive-basename }}}.{{{ llvm-archive-extension }}}
89-
llvm-sanitizer-config: {{#if (and (ne compiler 'clang') (ne compiler 'apple-clang'))}}{{else if ubsan}}Undefined{{else if asan}}Address{{else if msan}}MemoryWithOrigins{{/if}}
89+
llvm-sanitizer-config: {{#if (and (ne compiler 'clang') (ne compiler 'apple-clang'))}}{{else if asan}}Address{{else if msan}}MemoryWithOrigins{{/if}}
9090
warning-flags: {{#if (eq compiler 'msvc') }}/WX /W4 {{else}}-Werror -Wall {{/if}}
9191
common-flags-base: {{#if (ieq compiler 'clang')}}-gz=zstd {{/if}}
9292
common-flags: {{{ common-flags-base }}}{{#if msan }}-fsanitize-memory-track-origins {{/if}}
@@ -158,7 +158,7 @@ jobs:
158158
# We need git to ensure actions/checkout@v4 will use git and
159159
# for the next steps that need to clone repositories
160160
- name: Install Git
161-
uses: alandefreitas/cpp-actions/package-install@v1.9.1
161+
uses: alandefreitas/cpp-actions/package-install@v1.9.2
162162
if: matrix.container != ''
163163
env:
164164
DEBIAN_FRONTEND: 'noninteractive'
@@ -175,7 +175,7 @@ jobs:
175175
uses: actions/checkout@v4
176176

177177
- name: Setup CMake
178-
uses: alandefreitas/cpp-actions/setup-cmake@v1.9.1
178+
uses: alandefreitas/cpp-actions/setup-cmake@v1.9.2
179179
id: setup-cmake
180180
with:
181181
version: '>=3.26'
@@ -187,7 +187,7 @@ jobs:
187187
uses: seanmiddleditch/gha-setup-ninja@v5
188188

189189
- name: Setup C++
190-
uses: alandefreitas/cpp-actions/setup-cpp@v1.9.1
190+
uses: alandefreitas/cpp-actions/setup-cpp@v1.9.2
191191
id: setup-cpp
192192
with:
193193
compiler: ${{ matrix.compiler }}
@@ -261,7 +261,7 @@ jobs:
261261
${{ steps.setup-cpp.outputs.cxx }} --print-target-triple
262262
263263
- name: Install System Packages
264-
uses: alandefreitas/cpp-actions/package-install@v1.9.1
264+
uses: alandefreitas/cpp-actions/package-install@v1.9.2
265265
if: matrix.compiler != 'msvc'
266266
id: package-install
267267
env:
@@ -362,7 +362,7 @@ jobs:
362362
363363
- name: Install libc++
364364
id: install_libcxx
365-
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.1
365+
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.2
366366
if: matrix.use-libcxx == 'true' && steps.llvm-cache.outputs.cache-hit != 'true'
367367
with:
368368
cmake-version: '>=3.26'
@@ -396,7 +396,7 @@ jobs:
396396
# This is controlled by the llvm-runtimes matrix variable.
397397
- name: Install LLVM
398398
id: install_llvm
399-
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.1
399+
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.2
400400
if: steps.llvm-cache.outputs.cache-hit != 'true'
401401
with:
402402
cmake-version: '>=3.26'
@@ -434,7 +434,7 @@ jobs:
434434
rm -r ../third-party/llvm-project
435435
436436
- name: Install JerryScript
437-
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.1
437+
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.2
438438
with:
439439
source-dir: ../third-party/jerryscript
440440
url: https://github.com/jerryscript-project/jerryscript/archive/refs/tags/v3.0.0.tar.gz
@@ -468,7 +468,7 @@ jobs:
468468
-D JERRY_LIBC=OFF
469469
470470
- name: Install Lua
471-
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.1
471+
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.2
472472
with:
473473
source-dir: ../third-party/lua
474474
url: https://github.com/lua/lua/archive/refs/tags/v5.4.8.tar.gz
@@ -488,7 +488,7 @@ jobs:
488488
trace-commands: true
489489

490490
- name: Install Libxml2
491-
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.1
491+
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.2
492492
if: matrix.compiler == 'msvc'
493493
with:
494494
source-dir: ../third-party/libxml2
@@ -547,10 +547,7 @@ jobs:
547547
node-version: '20'
548548

549549
- name: CMake Workflow
550-
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.1
551-
env:
552-
# Bump per-test timeout on Windows and for MSan jobs to avoid CTest default (1500s) killing slow golden suites.
553-
CTEST_TEST_TIMEOUT: ${{ (runner.os == 'Windows' || matrix.msan == 'true') && '3600' || '' }}
550+
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.2
554551
with:
555552
cmake-version: '>=3.26'
556553
cxxstd: ${{ matrix.cxxstd }}
@@ -578,6 +575,7 @@ jobs:
578575
package-dir: packages
579576
package-generators: ${{ matrix.mrdocs-package-generators }}
580577
package-artifact: false
578+
ctest-timeout: 3600
581579

582580
- name: Check YAML schema
583581
run: |
@@ -664,7 +662,7 @@ jobs:
664662
retention-days: 1
665663

666664
- name: FlameGraph
667-
uses: alandefreitas/cpp-actions/flamegraph@v1.9.1
665+
uses: alandefreitas/cpp-actions/flamegraph@v1.9.2
668666
if: matrix.time-trace
669667
with:
670668
build-dir: build
@@ -740,7 +738,7 @@ jobs:
740738
fi
741739
742740
- name: Install packages
743-
uses: alandefreitas/cpp-actions/package-install@v1.9.1
741+
uses: alandefreitas/cpp-actions/package-install@v1.9.2
744742
id: package-install
745743
with:
746744
apt-get: build-essential asciidoctor cmake bzip2 git rsync
@@ -765,7 +763,7 @@ jobs:
765763
if: ${{ runner.os == 'Windows' }}
766764

767765
- name: Setup C++
768-
uses: alandefreitas/cpp-actions/setup-cpp@v1.9.1
766+
uses: alandefreitas/cpp-actions/setup-cpp@v1.9.2
769767
id: setup-cpp
770768
with:
771769
compiler: ${{ matrix.compiler }}
@@ -809,7 +807,7 @@ jobs:
809807
$MRDOCS_ROOT/bin/mrdocs --version
810808
811809
- name: Clone Boost.URL
812-
uses: alandefreitas/cpp-actions/boost-clone@v1.9.0
810+
uses: alandefreitas/cpp-actions/boost-clone@v1.9.2
813811
id: boost-url-clone
814812
with:
815813
branch: develop
@@ -896,8 +894,36 @@ jobs:
896894
npx gulp lint
897895
npx gulp
898896
897+
# Website publishing gate:
898+
# - Only publish on pushes to master/develop and on tags
899+
# - Only on Linux runners (the publish steps assume GNU tooling)
900+
#
901+
# Use `if: env.PUBLISH_WEBSITE == 'true'` for all steps that
902+
# write into `build/website/` and get deployed to the website.
903+
- name: Set website publish gate
904+
run: |
905+
is_publish_ref='false'
906+
if [[ "${{ github.event_name }}" == 'push' ]]; then
907+
if [[ "${{ github.ref_name }}" == 'master' || "${{ github.ref_name }}" == 'develop' ]]; then
908+
is_publish_ref='true'
909+
fi
910+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
911+
is_publish_ref='true'
912+
fi
913+
fi
914+
915+
publish_website="$is_publish_ref"
916+
if [[ "${{ runner.os }}" != 'Linux' ]]; then
917+
publish_website='false'
918+
fi
919+
920+
{
921+
echo "IS_PUBLISH_REF=$is_publish_ref"
922+
echo "PUBLISH_WEBSITE=$publish_website"
923+
} >> "$GITHUB_ENV"
924+
899925
- name: Ensure all refs for Antora
900-
if: github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) && runner.os == 'Linux'
926+
if: env.PUBLISH_WEBSITE == 'true'
901927
run: |
902928
set -euo pipefail
903929
# Make sure Antora sees every branch and tag from the upstream repo,
@@ -1132,16 +1158,31 @@ jobs:
11321158
path: demos-diff
11331159
retention-days: 30
11341160

1161+
# Generate a static roadmap page from the git-tracked issue index.
1162+
#
1163+
# Output location:
1164+
# - Writes `build/website/roadmap/index.html`.
1165+
# - The generator may copy `styles.css` into `build/website/` if it's missing,
1166+
# so the report can reference `../styles.css`.
1167+
# - Since the website is published from `build/website`, this becomes
1168+
# `/roadmap/` on the deployed site.
1169+
- name: Generate Roadmap Report
1170+
if: env.PUBLISH_WEBSITE == 'true'
1171+
run: |
1172+
set -euvx
1173+
cd ${{ github.workspace }}
1174+
python -m util.roadmap report -o build/website/roadmap
1175+
11351176
- name: Publish Website to GitHub Pages
1136-
if: github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) && runner.os == 'Linux'
1177+
if: env.PUBLISH_WEBSITE == 'true'
11371178
uses: peaceiris/actions-gh-pages@v3
11381179
with:
11391180
github_token: ${{ secrets.GITHUB_TOKEN }}
11401181
publish_dir: build/website
11411182
force_orphan: true
11421183

11431184
- name: Publish website
1144-
if: github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) && runner.os == 'Linux'
1185+
if: env.PUBLISH_WEBSITE == 'true'
11451186
env:
11461187
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
11471188
run: |
@@ -1166,7 +1207,7 @@ jobs:
11661207
time rsync "${rsyncopts[@]}" $(pwd)/demos/ "$demo_dir"/
11671208
11681209
- name: Create changelog
1169-
uses: alandefreitas/cpp-actions/create-changelog@v1.9.1
1210+
uses: alandefreitas/cpp-actions/create-changelog@v1.9.2
11701211
with:
11711212
output-path: CHANGELOG.md
11721213
thank-non-regular: ${{ startsWith(github.ref, 'refs/tags/') }}
@@ -1175,7 +1216,7 @@ jobs:
11751216
update-summary: ${{ runner.os == 'Linux' && 'true' || 'false' }}
11761217

11771218
- name: Create GitHub Package Release
1178-
if: ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }}
1219+
if: env.IS_PUBLISH_REF == 'true'
11791220
uses: softprops/action-gh-release@v2
11801221
with:
11811222
files: packages/MrDocs-*.*.*-*.*
@@ -1238,7 +1279,7 @@ jobs:
12381279
echo "llvm-cache-key=$llvm_cache_key" >> $GITHUB_OUTPUT
12391280
12401281
- name: Install packages
1241-
uses: alandefreitas/cpp-actions/package-install@v1.9.1
1282+
uses: alandefreitas/cpp-actions/package-install@v1.9.2
12421283
id: package-install
12431284
with:
12441285
apt-get: ${{ matrix.install }}
@@ -1248,4 +1289,4 @@ jobs:
12481289
uses: actions/cache@v4
12491290
with:
12501291
path: ${{ steps.rmatrix.outputs.llvm-path }}
1251-
key: ${{ steps.rmatrix.outputs.llvm-cache-key }}
1292+
key: ${{ steps.rmatrix.outputs.llvm-cache-key }}

0 commit comments

Comments
 (0)