add build CI workflow #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-linux: | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
compiler: [gcc-9, gcc-14, clang-9, clang-19] | |
include: | |
- compiler: gcc-9 | |
cxx: g++-9 | |
libcxx: libstdc++11 | |
install: | | |
sudo apt install -y gcc-9 g++-9 | |
- compiler: gcc-14 | |
cxx: g++-14 | |
libcxx: libstdc++11 | |
- compiler: clang-9 | |
cxx: clang++-9 | |
libcxx: libc++ | |
install: | | |
sudo apt-add-repository 'deb http://archive.ubuntu.com/ubuntu focal main universe' | |
sudo apt install -y clang-9 libc++-9-dev libc++abi-9-dev | |
- compiler: clang-19 | |
cxx: clang++-19 | |
libcxx: libc++ | |
install: | | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
sudo apt-add-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main' | |
sudo apt install -y clang-19 libc++-19-dev libc++abi-19-dev | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
${{ matrix.install }} | |
- name: Build | |
env: | |
CC: ${{ matrix.compiler }} | |
CXX: ${{ matrix.cxx }} | |
LIBCXX: ${{ matrix.libcxx }} | |
run: | | |
python -m venv venv | |
source ./venv/bin/activate | |
pip install conan | |
source ~/.profile | |
conan config install --type dir ./.github/conan_config | |
conan install . -of=build --build=missing | |
cmake -B build -DSBEPP_BUILD_TESTS=ON -DSBEPP_SEPARATE_TESTS=OFF --preset conan-debug | |
cmake --build build --preset conan-debug --parallel $(nproc) | |
- name: Run tests | |
run: ctest --test-dir build --output-on-failure --parallel --build-config Debug | |
build-windows: | |
runs-on: windows-2022 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: | | |
python -m venv venv | |
.\venv\Scripts\activate | |
pip install conan | |
conan profile detect | |
conan profile show | |
conan install . -of=build --build=missing -s build_type=Debug | |
cmake -B build -DSBEPP_BUILD_TESTS=ON -DSBEPP_SEPARATE_TESTS=OFF --preset conan-default | |
$threads = (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors | |
cmake --build build --preset conan-debug --parallel $threads | |
- name: Run tests | |
run: ctest --test-dir build --output-on-failure --parallel --build-config Debug |