File tree Expand file tree Collapse file tree 8 files changed +59
-25
lines changed Expand file tree Collapse file tree 8 files changed +59
-25
lines changed Original file line number Diff line number Diff line change 88 build :
99 runs-on : ubuntu-latest
1010
11+ strategy :
12+ fail-fast : false
13+ matrix :
14+ config : [gcc-libstdc++, clang-libc++]
15+
16+ name : build • ${{ matrix.config }}
17+
1118 steps :
12- - uses : actions/checkout@v4
19+ - uses : actions/checkout@v4
1320
14- - name : Install Nix
15- uses : cachix/install-nix-action@v31 # 2025-05-27, from https://github.com/cachix/install-nix-action/tags
16- with :
17- nix_path : nixpkgs=channel:nixos-25.05 # latest release
21+ - name : Install Nix
22+ uses : cachix/install-nix-action@v31 # 2025-05-27, from https://github.com/cachix/install-nix-action/tags
23+ with :
24+ nix_path : nixpkgs=channel:nixos-25.05 # latest release
1825
19- - name : Configure, build, test
20- run : |
21- nix-shell --pure --run "ci/scripts/configure.sh"
22- nix-shell --pure --run "ci/scripts/build.sh"
23- nix-shell --pure --run "ci/scripts/test.sh"
26+ - name : Run CI script
27+ env :
28+ CI_CONFIG : ci/configs/${{ matrix.config }}.sh
29+ run : ci/run.sh
Original file line number Diff line number Diff line change 1+ NIX_ARGS=(
2+ --arg libcxx true
3+ )
4+ CMAKE_ARGS=(
5+ -DCMAKE_BUILD_TYPE=Debug
6+ -DCMAKE_CXX_COMPILER=clang++
7+ -DCMAKE_CXX_STANDARD_LIBRARY=libc++
8+ -DCMAKE_CXX_FLAGS=" -Werror -Wall -Wextra -Wpedantic -Wthread-safety-analysis -Wno-unused-parameter"
9+ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
10+ -DMP_ENABLE_CLANG_TIDY=ON
11+ -DMP_ENABLE_IWYU=ON
12+ )
Original file line number Diff line number Diff line change 1+ CMAKE_ARGS=(
2+ -DCMAKE_BUILD_TYPE=Debug
3+ -DCMAKE_CXX_FLAGS=" -Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter"
4+ )
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euxo pipefail
3+
4+ [ " ${CI_CONFIG+x} " ] && source " $CI_CONFIG "
5+
6+ for stage in configure build test ; do
7+ nix-shell --pure --keep CI_CONFIG " ${NIX_ARGS[@]+" ${NIX_ARGS[@]} " } " --run ci/scripts/${stage} .sh shell.nix
8+ done
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2- set -euo pipefail
2+ set -euxo pipefail
33
44cmake --build build -t all tests mpexamples -- -k 0
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2- set -euo pipefail
2+ set -euxo pipefail
33
4- cmake -B build -G Ninja \
5- -DCMAKE_BUILD_TYPE=Debug \
6- -DCMAKE_CXX_COMPILER=clang++ \
7- -DCMAKE_CXX_FLAGS=" -Wall -Wextra -Wpedantic -Wthread-safety-analysis -Wno-unused-parameter" \
8- -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
9- -DMP_ENABLE_CLANG_TIDY=ON \
10- -DMP_ENABLE_IWYU=ON
4+ [ " ${CI_CONFIG+x} " ] && source " $CI_CONFIG "
5+
6+ cmake -B build -G Ninja " ${CMAKE_ARGS[@]+" ${CMAKE_ARGS[@]} " } "
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2- set -euo pipefail
2+ set -euxo pipefail
33
44ctest --test-dir build --output-on-failure
Original file line number Diff line number Diff line change 1- { pkgs ? import <nixpkgs> { } } :
1+ { pkgs ? import <nixpkgs> { }
2+ , libcxx ? false # Whether to use libc++ toolchain and libraries instead of libstdc++
3+ } :
24
3- pkgs . mkShell {
4- buildInputs = with pkgs ; [
5+ let
6+ lib = pkgs . lib ;
7+ llvm = pkgs . llvmPackages_20 ;
8+ mkShell = pkgs . mkShell . override ( lib . optionalAttrs libcxx { stdenv = llvm . libcxxStdenv ; } ) ;
9+ capnproto = pkgs . capnproto . override ( lib . optionalAttrs libcxx { clangStdenv = llvm . libcxxStdenv ; } ) ;
10+ in mkShell {
11+ buildInputs = [
512 capnproto
13+ llvm . libcxx
614 ] ;
715 nativeBuildInputs = with pkgs ; [
816 cmake
917 include-what-you-use
10- llvmPackages_20 . clang
11- llvmPackages_20 . clang-tools
18+ llvm . clang
19+ llvm . clang-tools
1220 ninja
1321 ] ;
1422}
You can’t perform that action at this time.
0 commit comments