99 tags :
1010 - " v*.*.*"
1111
12- # pull_request runs the matrix/build on the PR head with the fork-scoped token
13- # (no comment perms on base repo).
1412 pull_request :
1513 branches :
1614 - develop
1715
18-
1916concurrency :
2017 group : ${{format('{0}:{1}', github.repository, github.ref)}}
2118 cancel-in-progress : true
2623 container :
2724 image : ubuntu:24.04
2825 name : Generate Test Matrix
29- # Permissions allow Danger to read PR context and post comments.
30- permissions :
31- contents : read
32- pull-requests : write
3326 outputs :
3427 matrix : ${{ steps.cpp-matrix.outputs.matrix }}
3528 llvm-matrix : ${{ steps.llvm-matrix.outputs.llvm-matrix }}
5851 apple-clang *
5952 standards : ' 20'
6053 latest-factors : |
54+ msvc Optimized-Debug
6155 gcc UBSan Coverage
6256 clang UBSan ASan MSan
6357 apple-clang UBSan ASan
@@ -72,17 +66,22 @@ jobs:
7266 clang: Release
7367 apple-clang: Release
7468 msvc: RelWithDebInfo
69+ msvc Optimized-Debug: Debug
70+ ccflags : |
71+ msvc Optimized-Debug: /Ob1 /O2 /Zi
72+ cxxflags : |
73+ msvc Optimized-Debug: /Ob1 /O2 /Zi
7574 install : |
76- gcc: git build-essential pkg-config python3 curl unzip openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev
77- gcc Coverage: git build-essential pkg-config python3 curl unzip openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev lcov
78- 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
75+ gcc: git build-essential pkg-config python3 curl openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev
76+ gcc Coverage: git build-essential pkg-config python3 curl openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev lcov
77+ clang: git build-essential pkg-config python3 curl openjdk-11-jdk pkg-config libncurses-dev libxml2-utils libxml2-dev g++-14=14.2.0-4ubuntu2~24.04
7978 msvc: ''
8079 extra-values : |
8180 use-libcxx: {{#if (and (ieq compiler 'clang') (ge major 19)) }}true{{else}}false{{/if}}
8281 libcxx-runtimes: libcxx{{#if (ne compiler 'msvc')}};libcxxabi{{/if}}
8382 llvm-runtimes: {{#if (ine use-libcxx 'true') }}{{{ libcxx-runtimes }}}{{/if}}
8483 llvm-hash: dc4cef81d47c7bc4a3c4d58fbacf8a6359683fae
85- llvm-build-preset-prefix: {{{ lowercase build-type}}}
84+ llvm-build-preset-prefix: {{#if optimized-debug}}optimizeddebug{{else}}{{{ lowercase build-type}}}{{/if }}
8685 llvm-build-preset-os: {{#if (ieq os 'windows') }}win{{else}}unix{{/if}}
8786 llvm-sanitizer: {{#if (eq compiler 'gcc')}}{{else if ubsan}}-UBSan{{else if asan}}-ASan{{else if msan}}-MSan{{/if}}
8887 llvm-build-preset: {{{ llvm-build-preset-prefix }}}-{{{ llvm-build-preset-os }}}
@@ -332,6 +331,36 @@ jobs:
332331 path : ${{ steps.rmatrix.outputs.llvm-path }}
333332 key : ${{ matrix.llvm-archive-basename }}
334333
334+ - name : Download LLVM Binaries
335+ id : llvm-download
336+ if : steps.llvm-cache.outputs.cache-hit != 'true'
337+ run : |
338+ set -x
339+ url=https://mrdocs.com/llvm+clang/${{ matrix.llvm-archive-filename }}
340+ http_status=$(curl -s -o /dev/null -w "%{http_code}" -I "$url")
341+ if [ "$http_status" -eq 200 ]; then
342+ found="true"
343+ echo "found=$found" >> $GITHUB_OUTPUT
344+ curl -L -o ${{ matrix.llvm-archive-filename }} "$url"
345+ install_prefix=${{ steps.rmatrix.outputs.llvm-path }}
346+ mkdir -p $install_prefix
347+ if [[ ${{ matrix.llvm-archive-extension }} == '7z' ]]; then
348+ 7z x ${{ matrix.llvm-archive-filename }} -o$install_prefix
349+ else
350+ tar -xjf ${{ matrix.llvm-archive-filename }} -C $install_prefix
351+ fi
352+ if [[ $(ls -1 $install_prefix | wc -l) -eq 1 ]]; then
353+ single_dir=$(ls -1 $install_prefix)
354+ if [[ -d $install_prefix/$single_dir ]]; then
355+ mv $install_prefix/$single_dir/* $install_prefix/
356+ rmdir $install_prefix/$single_dir
357+ fi
358+ fi
359+ else
360+ found="false"
361+ echo "found=$found" >> $GITHUB_OUTPUT
362+ fi
363+
335364 # Installs libc++ separately, using the LLVM standalone runtimes build.
336365 # The libc++ built here will be built using the host compiler, so this is
337366 # limited by what libc++ at the current LLVM revision supports.
@@ -345,27 +374,16 @@ jobs:
345374 # FIXME: Build this for the GCC and MacOS sanitizer jobs.
346375 # Currently GCC fails linking it, and for MacOS there are compiler-rt
347376 # requirements not satisfied.
348- - name : Fetch LLVM source archive
349- if : steps.llvm-cache.outputs.cache-hit != 'true'
350- run : |
351- set -eux
352- mkdir -p ../third-party
353- cd ../third-party
354- archive="llvm-${{ matrix.llvm-hash }}.zip"
355- if [ ! -d llvm-project ]; then
356- curl -L -o "$archive" "https://github.com/llvm/llvm-project/archive/${{ matrix.llvm-hash }}.zip"
357- unzip -q "$archive"
358- mv "llvm-project-${{ matrix.llvm-hash }}" llvm-project
359- rm "$archive"
360- fi
361-
362377 - name : Install libc++
363378 id : install_libcxx
364379 uses :
alandefreitas/cpp-actions/[email protected] 365- if : matrix.use-libcxx == 'true' && steps.llvm-cache.outputs.cache-hit != 'true'
380+ if : matrix.use-libcxx == 'true' && steps.llvm-cache.outputs.cache-hit != 'true' && steps.llvm-download.outputs.found != 'true'
366381 with :
367382 cmake-version : ' >=3.26'
368383 source-dir : ../third-party/llvm-project/runtimes
384+ git-repository : https://github.com/llvm/llvm-project.git
385+ git-tag : ${{ matrix.llvm-hash }}
386+ download-dir : ../third-party/llvm-project
369387 build-dir : ${sourceDir}/build
370388 build-type : ${{ matrix.build-type }}
371389 extra-args : |
@@ -396,13 +414,16 @@ jobs:
396414 - name : Install LLVM
397415 id : install_llvm
398416 uses :
alandefreitas/cpp-actions/[email protected] 399- if : steps.llvm-cache.outputs.cache-hit != 'true'
417+ if : steps.llvm-cache.outputs.cache-hit != 'true' && steps.llvm-download.outputs.found != 'true'
400418 with :
401419 cmake-version : ' >=3.26'
402420 source-dir : ../third-party/llvm-project/llvm
421+ git-repository : https://github.com/llvm/llvm-project.git
422+ git-tag : ${{ matrix.llvm-hash }}
423+ download-dir : ../third-party/llvm-project
403424 patches : |
404- ./third-party/patches/llvm/ llvm/CMakePresets.json
405- ./third-party/patches/llvm/ llvm/CMakeUserPresets.json
425+ ./third-party/llvm/CMakePresets.json
426+ ./third-party/llvm/CMakeUserPresets.json
406427 build-dir : ${sourceDir}/build
407428 preset : ${{ matrix.llvm-build-preset }}
408429 build-type : ${{ matrix.build-type }}
@@ -438,8 +459,8 @@ jobs:
438459 source-dir : ../third-party/duktape
439460 url : https://github.com/svaarala/duktape/releases/download/v2.7.0/duktape-2.7.0.tar.xz
440461 patches : |
441- ./third-party/patches/ duktape/CMakeLists.txt
442- ./third-party/patches/ duktape/duktapeConfig.cmake.in
462+ ./third-party/duktape/CMakeLists.txt
463+ ./third-party/duktape/duktapeConfig.cmake.in
443464 build-dir : ${sourceDir}/build
444465 cc : ${{ steps.setup-cpp.outputs.cc }}
445466 cxx : ${{ steps.setup-cpp.outputs.cxx }}
@@ -458,8 +479,8 @@ jobs:
458479 source-dir : ../third-party/lua
459480 url : https://github.com/lua/lua/archive/refs/tags/v5.4.8.tar.gz
460481 patches : |
461- ./third-party/patches/ lua/CMakeLists.txt
462- ./third-party/patches/ lua/LuaConfig.cmake.in
482+ ./third-party/lua/CMakeLists.txt
483+ ./third-party/lua/LuaConfig.cmake.in
463484 build-dir : ${sourceDir}/build
464485 cc : ${{ steps.setup-cpp.outputs.cc }}
465486 cxx : ${{ steps.setup-cpp.outputs.cxx }}
@@ -881,17 +902,6 @@ jobs:
881902 npx gulp lint
882903 npx gulp
883904
884- - name : Ensure all refs for Antora
885- if : github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) && runner.os == 'Linux'
886- run : |
887- set -euo pipefail
888- # Make sure Antora sees every branch and tag from the upstream repo,
889- # regardless of who triggered the workflow.
890- git remote set-url origin https://github.com/cppalliance/mrdocs.git
891- git fetch --prune --prune-tags origin \
892- '+refs/heads/*:refs/remotes/origin/*' \
893- '+refs/tags/*:refs/tags/*'
894-
895905 - name : Generate Remote Documentation
896906 working-directory : docs
897907 run : |
@@ -1009,7 +1019,6 @@ jobs:
10091019 root="$(pwd)/demos/$project/$variant"
10101020 src="$root/adoc"
10111021 dst="$root/adoc-asciidoc"
1012- stylesheet="$(pwd)/share/mrdocs/addons/generator/common/layouts/style.css"
10131022
10141023 # Create the top-level output dir
10151024 mkdir -p "$dst"
@@ -1020,7 +1029,7 @@ jobs:
10201029 rel="${f#"$src/"}" # path relative to $src
10211030 outdir="$dst/$(dirname "$rel")" # mirror subdir inside $dst
10221031 mkdir -p "$outdir"
1023- asciidoctor -a stylesheet="${stylesheet}" - D "$outdir" "$f"
1032+ asciidoctor -D "$outdir" "$f"
10241033 done
10251034 done
10261035 fi
@@ -1224,9 +1233,69 @@ jobs:
12241233 with :
12251234 apt-get : ${{ matrix.install }}
12261235
1236+ - name : Check website releases
1237+ id : website-releases
1238+ run : |
1239+ set -x
1240+ archive_url="https://mrdocs.com/llvm+clang/${{ matrix.llvm-archive-filename }}"
1241+ http_status=$(curl -s -o /dev/null -w "%{http_code}" -I "$archive_url")
1242+ if [ "$http_status" -eq 200 ]; then
1243+ exists="true"
1244+ else
1245+ exists="false"
1246+ fi
1247+ echo "exists=$exists" >> $GITHUB_OUTPUT
1248+
12271249 - name : LLVM Binaries
12281250 id : llvm-cache
1251+ if : steps.website-releases.outputs.exists != 'true'
12291252 uses : actions/cache@v4
12301253 with :
12311254 path : ${{ steps.rmatrix.outputs.llvm-path }}
12321255 key : ${{ matrix.llvm-archive-basename }}
1256+
1257+ - name : Compress LLVM
1258+ id : llvm-upload
1259+ if : steps.llvm-cache.outputs.cache-hit == 'true'
1260+ shell : bash
1261+ run : |
1262+ # LLVM is be installed with the default compiler
1263+ set -x
1264+
1265+ # Use 7z on windows
1266+ if [[ ${{ runner.os }} == 'Windows' ]]; then
1267+ 7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on "${{ matrix.llvm-archive-filename }}" "${{ steps.rmatrix.outputs.llvm-path }}"
1268+ else
1269+ tar -cjf "${{ matrix.llvm-archive-filename }}" -C "${{ steps.rmatrix.outputs.llvm-path }}/.." llvm
1270+ fi
1271+
1272+ - name : Website LLVM Releases
1273+ if : steps.llvm-cache.outputs.cache-hit == 'true' && github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/'))
1274+ run : |
1275+ set -x
1276+
1277+ # Ensure required commands exist
1278+ for cmd in ssh-keyscan ssh-agent ssh-add scp; do
1279+ if ! command -v $cmd >/dev/null; then
1280+ echo "$cmd not found"
1281+ exit 1
1282+ fi
1283+ done
1284+
1285+ # Add SSH key
1286+ mkdir -p ~/.ssh
1287+ ssh-keyscan dev-websites.cpp.al >> ~/.ssh/known_hosts
1288+ chmod 600 ~/.ssh/known_hosts
1289+ echo "${{ secrets.DEV_WEBSITES_SSH_KEY }}" > ~/.ssh/github_actions
1290+ chmod 600 ~/.ssh/github_actions
1291+
1292+ # Start ssh-agent and add the key
1293+ SSH_AUTH_SOCK="$RUNNER_TEMP/ssh_agent.sock"
1294+ export SSH_AUTH_SOCK
1295+ ssh-agent -a $SSH_AUTH_SOCK > /dev/null
1296+ ssh-add ~/.ssh/github_actions
1297+
1298+ # Copy llvm archive: This step will copy the archive to www.mrdocs.com/llvm+clang
1299+ llvm_dir="/var/www/mrdox.com/llvm+clang"
1300+ chmod 755 ${{ matrix.llvm-archive-filename }}
1301+ scp -o StrictHostKeyChecking=no $(pwd)/${{ matrix.llvm-archive-filename }} [email protected] :$llvm_dir/
0 commit comments