Pull request with the latest version of the project #6
This file contains hidden or 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: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: ${{ matrix.compiler }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
compiler: [gcc, clang] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
if [ "${{ matrix.compiler }}" = "gcc" ]; then | |
sudo apt-get install -y gcc g++ cmake make | |
echo "CC=gcc" >> $GITHUB_ENV | |
echo "CXX=g++" >> $GITHUB_ENV | |
else | |
sudo apt-get install -y clang cmake make | |
echo "CC=clang" >> $GITHUB_ENV | |
echo "CXX=clang++" >> $GITHUB_ENV | |
fi | |
- name: Configure project | |
run: | | |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release | |
- name: Build project | |
run: | | |
cmake --build build -- -j$(nproc) | |
- name: Run tests | |
run: | | |
ctest --test-dir build --output-on-failure |