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 8
8
build :
9
9
runs-on : ubuntu-latest
10
10
11
+ strategy :
12
+ fail-fast : false
13
+ matrix :
14
+ config : [gcc-libstdc++, clang-libc++]
15
+
16
+ name : build • ${{ matrix.config }}
17
+
11
18
steps :
12
- - uses : actions/checkout@v4
19
+ - uses : actions/checkout@v4
13
20
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
18
25
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 1
1
#! /usr/bin/env bash
2
- set -euo pipefail
2
+ set -euxo pipefail
3
3
4
4
cmake --build build -t all tests mpexamples -- -k 0
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
- set -euo pipefail
2
+ set -euxo pipefail
3
3
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 1
1
#! /usr/bin/env bash
2
- set -euo pipefail
2
+ set -euxo pipefail
3
3
4
4
ctest --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
+ } :
2
4
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 = [
5
12
capnproto
13
+ llvm . libcxx
6
14
] ;
7
15
nativeBuildInputs = with pkgs ; [
8
16
cmake
9
17
include-what-you-use
10
- llvmPackages_20 . clang
11
- llvmPackages_20 . clang-tools
18
+ llvm . clang
19
+ llvm . clang-tools
12
20
ninja
13
21
] ;
14
22
}
You can’t perform that action at this time.
0 commit comments