Skip to content

Improve cmake modules #6

Improve cmake modules

Improve cmake modules #6

name: Build and test on Linux
on:
pull_request:
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README.md'
- '.githooks/**'
jobs:
build-and-test:
runs-on: ubuntu-22.04
strategy:
matrix:
cxx: [g++-11, g++-12, g++-13, clang++-17, clang++-18, clang++-19]
include:
- cxx: g++-11
install: sudo apt install g++-11
- cxx: g++-12
install: sudo apt install g++-12
- cxx: g++-13
install: sudo apt install g++-13
- cxx: clang++-17
install: sudo apt install clang-17
- cxx: clang++-18
install: sudo apt install clang-18
- cxx: clang++-19
install: sudo apt install clang-19
steps:
- uses: actions/checkout@v4
- name: Add repositories for newer GCC
run: |
sudo apt-add-repository ppa:ubuntu-toolchain-r/test
if: ${{ matrix.cxx == 'g++-13' }}
- name: Add repositories for newer Clang
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo add-apt-repository -y deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main
sudo add-apt-repository -y deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
sudo add-apt-repository -y deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
if: ${{ matrix.cxx == 'clang++-17' || matrix.cxx == 'clang++-18' || matrix.cxx == 'clang++-19' }}
- name: Add Ubuntu mirrors
run: |
# Github Actions caching proxy is at times unreliable
# see https://github.com/actions/runner-images/issues/7048
printf 'http://azure.archive.ubuntu.com/ubuntu\tpriority:1\n' | sudo tee /etc/apt/mirrors.txt
curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt
sudo sed -i 's~http://azure.archive.ubuntu.com/ubuntu/~mirror+file:/etc/apt/mirrors.txt~' /etc/apt/sources.list
- name: Create Build Environment
run: |
sudo apt update
${{matrix.install}}
sudo apt install ninja-build
- name: Build and test
env:
CXX: ${{matrix.cxx}}
run: |
cmake --workflow --preset linux-release