Skip to content

[build] Increase clang minimum version to 14, use newly added Ubuntu 24.04 CI image to test clang 14 - 18 #3214

[build] Increase clang minimum version to 14, use newly added Ubuntu 24.04 CI image to test clang 14 - 18

[build] Increase clang minimum version to 14, use newly added Ubuntu 24.04 CI image to test clang 14 - 18 #3214

Workflow file for this run

# TODO(2.0): Support g++ once they fix coroutines. This also blocks MinGW and ManyLinux builds.
name: Quick Tests
on:
pull_request:
paths-ignore:
- 'doc/**'
push:
branches:
- master
- v2
- 'release-*'
jobs:
Linux-musl:
# Docker images are no longer cached on the 24.04 runner, use 22.04 instead
runs-on: ubuntu-22.04
# We depend on both clang and libc++. Alpine Linux 3.17 seems to be the first version to include
# a libc++ package (based on LLVM 15), but building capnproto failed when I tried it.
# Alpine Linux 3.18's libc++ package is from LLVM 16, however, and worked out-of-the-box, so
# Clang 16 appears to be the earliest Clang version we can run easily on Alpine Linux.
container: alpine:3.18.2
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: apk add autoconf automake bash build-base cmake libtool libucontext-dev linux-headers openssl-dev clang16 libc++-dev
- name: super-test
run: ./super-test.sh quick clang-16
Linux-clang:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
clang: [14, 15, 16, 17, 18]
driver: [bazel, super-test]
include:
- driver: bazel
run-test: cd c++ && bazel test --verbose_failures --test_output=errors -k //...
- driver: super-test
run-test: ./super-test.sh quick
steps:
- uses: actions/checkout@v4
- name: install dependencies
# I observed 404s for some packages and added an `apt-get update`. Then, I observed package
# conflicts between LLVM 14 and 15, and added the line which removes LLVM 18, the default on
# Ubuntu as of this writing.
# TODO
# sudo apt-get remove clang-18 libc++1-18 libc++abi1-18 libc++-18-dev libc++abi-18-dev libunwind-18 libunwind-18-dev
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y build-essential git zlib1g-dev cmake libssl-dev clang-${{ matrix.clang }} libc++-${{ matrix.clang }}-dev libc++abi-${{ matrix.clang }}-dev ${{ matrix.libunwind }}
- name: test
run: |
export CC=clang-${{ matrix.clang }}
export CXX=clang++-${{ matrix.clang }}
${{ matrix.run-test }}
MacOS:
runs-on: macos-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
brew install autoconf automake libtool pkg-config
- name: super-test
run: |
./super-test.sh quick
MSVC:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['windows-latest']
include:
- os: windows-latest
target: 'Visual Studio 17 2022'
arch: -A x64
steps:
- uses: actions/checkout@v4
- name: Include $CONDA in $PATH
run: |
echo "$Env:CONDA\condabin" >> $env:GITHUB_PATH
- name: Install dependencies via Conda
run: |
conda update -n base -c defaults -q conda
conda install -n base -c defaults -q ninja openssl zlib
- name: Build and test
shell: cmd
run: |
echo "Activate conda base environment"
call activate base
echo "Building Cap'n Proto with ${{ matrix.target }}"
cmake -Hc++ -Bbuild-output ${{ matrix.arch }} -G "${{ matrix.target }}" -DCMAKE_BUILD_TYPE=debug -DCMAKE_PREFIX_PATH="%CONDA_PREFIX%" -DCMAKE_INSTALL_PREFIX=%CD%\capnproto-c++-install
cmake --build build-output --config debug --target install
echo "Building Cap'n Proto samples with ${{ matrix.target }}"
cmake -Hc++/samples -Bbuild-output-samples ${{ matrix.arch }} -G "${{ matrix.target }}" -DCMAKE_BUILD_TYPE=debug -DCMAKE_PREFIX_PATH=%CD%\capnproto-c++-install
cmake --build build-output-samples --config debug
cd build-output\src
ctest -V -C debug