Skip to content

ci: enhance CI workflow with matrix strategy for OS and library types #4

ci: enhance CI workflow with matrix strategy for OS and library types

ci: enhance CI workflow with matrix strategy for OS and library types #4

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
build:
name: ${{matrix.os}}-release-${{matrix.lib}}
runs-on: ${{matrix.os}}
env:
CMAKE_GENERATOR: Ninja
DEBIAN_FRONTEND: noninteractive
defaults:
run:
shell: bash -e -o pipefail {0}
strategy:
matrix:
os:
- ubuntu-22.04
- ubuntu-24.04
lib:
- shared
- static
steps:
- name: install dependencies
run: |
sudo apt update
sudo apt install -y \
build-essential \
clang-format \
cmake \
ninja-build
- name: checkout repository
uses: actions/checkout@v4
- name: configure
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=${{matrix.lib == 'shared'}}
- name: build
run: |
cmake --build build
- name: test
run: |
cd build
ctest --output-on-failure
- name: install
run: |
sudo cmake --install build