Skip to content

Commit 0ffdb14

Browse files
committed
ci: add newdeps job testing newest versions of cmake and capnproto
1 parent fe1cd8c commit 0ffdb14

File tree

5 files changed

+32
-3
lines changed

5 files changed

+32
-3
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
uses: vmactions/freebsd-vm@v1
4848
with:
4949
prepare: |
50-
pkg install -y cmake ninja bash capnproto
50+
pkg install -y cmake ninja bash capnproto git
5151
sync: 'rsync'
5252
copyback: false
5353

@@ -79,7 +79,7 @@ jobs:
7979
strategy:
8080
fail-fast: false
8181
matrix:
82-
config: [default, llvm, gnu32, sanitize, olddeps]
82+
config: [default, llvm, gnu32, sanitize, olddeps, newdeps]
8383

8484
name: build • ${{ matrix.config }}
8585

ci/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ CI_CONFIG=ci/configs/llvm.bash ci/scripts/run.sh
2121
CI_CONFIG=ci/configs/gnu32.bash ci/scripts/run.sh
2222
CI_CONFIG=ci/configs/sanitize.bash ci/scripts/run.sh
2323
CI_CONFIG=ci/configs/olddeps.bash ci/scripts/run.sh
24+
CI_CONFIG=ci/configs/newdeps.bash ci/scripts/run.sh
2425
```
2526

2627
By default CI jobs will reuse their build directories. `CI_CLEAN=1` can be specified to delete them before running instead.

ci/configs/newdeps.bash

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CI_DESC="CI job using newest Cap'n Proto and cmake versions"
2+
CI_DIR=build-newdeps
3+
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wno-error=array-bounds"
4+
CAPNP_CHECKOUT=master
5+
NIX_ARGS=(--argstr capnprotoVersion "none" --argstr cmakeVersion "4.1.1")
6+
BUILD_ARGS=(-k)

ci/scripts/ci.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,26 @@ cmake --version
2121
cmake_ver=$(cmake --version | awk '/version/{print $3; exit}')
2222
ver_ge() { [ "$(printf '%s\n' "$2" "$1" | sort -V | head -n1)" = "$2" ]; }
2323

24+
# If CAPNP_CHECKOUT was requested, clone and install requested Cap'n Proto branch or tag
25+
capnp_prefix=
26+
if [ -n "${CAPNP_CHECKOUT-}" ]; then
27+
capnp_prefix="$PWD/capnp-install"
28+
[ -e "capnp" ] || git clone -b "${CAPNP_CHECKOUT}" "https://github.com/capnproto/capnproto" capnp
29+
mkdir -p capnp/build
30+
(
31+
cd capnp/build
32+
git --no-pager log -1 || true
33+
CXXFLAGS="-std=c++20" cmake .. "-DCMAKE_INSTALL_PREFIX=${capnp_prefix}" -DBUILD_TESTING=OFF -DWITH_OPENSSL=OFF -DWITH_ZLIB=OFF
34+
cmake --build .
35+
cmake --install .
36+
)
37+
export CMAKE_PREFIX_PATH="${capnp_prefix}:${CMAKE_PREFIX_PATH-}"
38+
fi
39+
2440
src_dir=$PWD
2541
mkdir -p "$CI_DIR"
2642
cd "$CI_DIR"
43+
git --no-pager log -1 || true
2744
cmake "$src_dir" "${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}"
2845
if ver_ge "$cmake_ver" "3.15"; then
2946
cmake --build . -t "${BUILD_TARGETS[@]}" -- "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}"

shell.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ let
4040
clang-tools = llvm.clang-tools.override { inherit enableLibcxx; };
4141
cmakeHashes = {
4242
"3.12.4" = "sha256-UlVYS/0EPrcXViz/iULUcvHA5GecSUHYS6raqbKOMZQ=";
43+
"4.1.1" = "sha256-sp9vGXM6oiS3djUHoQikJ+1Ixojh+vIrKcROHDBUkoI=";
4344
};
4445
cmakeBuild = if cmakeVersion == null then pkgs.cmake else (pkgs.cmake.overrideAttrs (old: {
4546
version = cmakeVersion;
@@ -50,11 +51,12 @@ let
5051
patches = [];
5152
})).override { isMinimalBuild = true; };
5253
in crossPkgs.mkShell {
53-
buildInputs = [
54+
buildInputs = lib.optionals (capnprotoVersion != "none") [
5455
capnproto
5556
];
5657
nativeBuildInputs = with pkgs; [
5758
cmakeBuild
59+
git
5860
include-what-you-use
5961
ninja
6062
] ++ lib.optionals (!minimal) [
@@ -64,4 +66,7 @@ in crossPkgs.mkShell {
6466

6567
# Tell IWYU where its libc++ mapping lives
6668
IWYU_MAPPING_FILE = if enableLibcxx then "${llvm.libcxx.dev}/include/c++/v1/libcxx.imp" else null;
69+
70+
# Avoid "SSL certificate problem: unable to get local issuer certificate" error during git clone in ci/scripts/ci.sh
71+
NIX_SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
6772
}

0 commit comments

Comments
 (0)