Skip to content

C++20 compatible polyfill for <expected> #1141

C++20 compatible polyfill for <expected>

C++20 compatible polyfill for <expected> #1141

Workflow file for this run

name: build
on:
push:
branches:
- main
paths:
- '.github/workflows/build.yml'
- 'include/**'
- 'tests/**'
- 'CMakeLists.txt'
- 'cmake/**'
- 'nix/**'
- 'flake.nix'
- 'flake.lock'
pull_request:
branches:
- main
paths:
- '.github/workflows/build.yml'
- 'include/**'
- 'tests/**'
- 'CMakeLists.txt'
- 'cmake/**'
- 'nix/**'
- 'flake.nix'
- 'flake.lock'
jobs:
linux:
runs-on:
group: runners-arm64
strategy:
fail-fast: false
matrix:
mode:
- cxx20
- cxx23
configuration:
- Debug
- Release
env:
- compiler: gcc
release: 12
- compiler: clang
release: 16
- compiler: clang
release: 17
- compiler: gcc
release: 13
- compiler: gcc
release: 14
- compiler: gcc
release: 15
- compiler: clang
release: 18
- compiler: clang
release: 19
- compiler: clang
release: 20
exclude:
- mode: cxx23
env.compiler: gcc

Check failure on line 63 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / build

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 63, Col: 13): Matrix exclude key 'env.compiler' does not match any key within the matrix .github/workflows/build.yml (Line: 64, Col: 13): Matrix exclude key 'env.release' does not match any key within the matrix
env.release: 12
- mode: cxx23
env.compiler: clang
env.release: 16
- mode: cxx23
env.compiler: clang
env.release: 17
container: libfn/ci-build-${{ matrix.env.compiler }}:${{ matrix.env.release }}
steps:
- uses: actions/checkout@v4
- name: Prepare build
run: |
mkdir .build
cd .build
cmake -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} ..
COMPILER=$( grep -iE "^CMAKE_CXX_COMPILER:FILEPATH=" CMakeCache.txt | sed -n 's/^[^=]*=//p' )
FLAGS=$( grep -iE "^CMAKE_CXX_FLAGS(_${{ matrix.configuration }})?:STRING" CMakeCache.txt | sed -n 's/^[^=]*=//p' | tr '\n' ' ' )
printf "C++ compiler path: %s\n" "$COMPILER"
"$COMPILER" --version
printf "C++ compilation options: %s\n" "$FLAGS"
- name: Build and test ${{ matrix.mode }}
run: |
cd .build
cmake --build . --target ${{ matrix.mode }}
ctest -L ${{ matrix.mode }} --output-on-failure
# Build and test all for one arbitrary configuration
- name: Build and test all
if: ${{ matrix.env.compiler == 'gcc' && matrix.env.release == '14' && matrix.mode == 'cxx23' }}
run: |
cd .build
cmake --build . --target clean
cmake --build .
ctest --output-on-failure
macos:
runs-on: macos-${{ matrix.env.osver }}
strategy:
fail-fast: false
matrix:
mode:
- cxx20
- cxx23
configuration:
- Debug
- Release
env:
- compiler: appleclang
osver: 15
- compiler: appleclang
osver: 14
- compiler: clang
release: 18
osver: 15
exclude:
- mode: cxx23
env.compiler: appleclang
env.osver: 14
steps:
- uses: actions/checkout@v4
- name: Prepare build
run: |
mkdir .build
cd .build
if [[ "${{ matrix.env.compiler }}" == "appleclang" ]]; then
export CXX="$(which clang++)"
export CC="$(which clang)"
fi
if [[ "${{ matrix.env.compiler }}" == "clang" ]]; then
export CXX="$(brew --prefix llvm@${{ matrix.env.release }})/bin/clang++"
export CC="$(brew --prefix llvm@${{ matrix.env.release }})/bin/clang"
fi
cmake -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} ..
COMPILER=$( grep -iE "^CMAKE_CXX_COMPILER:FILEPATH=" CMakeCache.txt | sed -n 's/^[^=]*=//p' )
FLAGS=$( grep -iE "^CMAKE_CXX_FLAGS(_${{ matrix.configuration }})?:STRING" CMakeCache.txt | sed -n 's/^[^=]*=//p' | tr '\n' ' ' )
printf "C++ compiler path: %s\n" "$COMPILER"
"$COMPILER" --version
printf "C++ compilation options: %s\n" "$FLAGS"
- name: Build and test ${{ matrix.mode }}
run: |
cd .build
cmake --build . --target ${{ matrix.mode }}
ctest -L ${{ matrix.mode }} --output-on-failure
# Build and test all for one arbitrary configuration
- name: Build and test all
if: ${{ matrix.env.compiler == 'appleclang' && matrix.env.osver == '15' && matrix.mode == 'cxx23' }}
run: |
cd .build
cmake --build . --target clean
cmake --build .
ctest --output-on-failure
windows:
runs-on: windows-${{ matrix.env.osver }}
strategy:
fail-fast: false
matrix:
mode:
- cxx20
configuration:
- Debug
- Release
env:
- compiler: "Visual Studio 17 2022"
osver: 2025
steps:
- uses: actions/checkout@v4
- name: Prepare build
shell: bash
run: |
mkdir .build
cd .build
cmake -G "${{ matrix.env.compiler }}" -A x64 ..
LINKER=$( grep -iE "^CMAKE_LINKER:FILEPATH=" CMakeCache.txt | sed -n 's/^[^=]*=//p' )
FLAGS=$( grep -iE "^CMAKE_CXX_FLAGS(_${{ matrix.configuration }})?:STRING" CMakeCache.txt | sed -n 's/^[^=]*=//p' | tr '\n' ' ' )
printf "C++ linker path: %s\n" "$LINKER"
"$LINKER" . || true
printf "C++ compilation options: %s\n" "$FLAGS"
- name: Build and test ${{ matrix.mode }}
shell: bash
run: |
cd .build
cmake --build . --target ${{ matrix.mode }} --config ${{ matrix.configuration }}
ctest -L ${{ matrix.mode }} -C ${{ matrix.configuration }} --output-on-failure
nixos:
runs-on:
group: runners-intel
strategy:
fail-fast: false
matrix:
compiler:
- gcc
- clang
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Build and test
run: nix -L build '.#${{matrix.compiler}}'