Skip to content

use ccache during CI runs #74

use ccache during CI runs

use ccache during CI runs #74

Workflow file for this run

name: build
on:
pull_request:
push:
branches: [master]
jobs:
build-and-test:
name: test on ${{ matrix.os }} with ${{ matrix.cxx }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-22.04
cxx: g++
coverage: "true"
- os: ubuntu-22.04
cxx: clang++
coverage: "false"
- os: macos-latest
cxx: clang++
coverage: "false"
# Do not auto-cancel other runners if one fails
fail-fast: false
env:
CXX: ${{ matrix.cxx }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
UV_SYSTEM_PYTHON: 1
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.cxx }}
create-symlink: true
- name: dependencies (libraries)
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: sudo apt-get install zlib1g-dev libisal-dev libdeflate-dev gcovr
- name: dependencies (libraries)
if: ${{ matrix.os == 'macos-latest' }}
run: brew install isa-l libdeflate
- name: dependencies (pip)
run: uv pip install meson ninja jsonschema sphinx
- name: setup
run: meson setup build -Db_sanitize=address,undefined -Db_coverage=${{ matrix.coverage }}
- name: install
run: DESTDIR=${PWD}/install meson install -C build
- name: examples
run: make -C examples EXE=${PWD}/build/src/adapterremoval3
- name: regression tests
run: meson test -C build --suite regression --print-errorlogs
# Unit tests are run last to enable cleanup of coverage data from other
# actions before running coveralls
- name: unit tests
run: |
find . -name '*.gcda' -print -delete
meson test -C build --suite unit --print-errorlogs
- name: coveralls
if: ${{ matrix.coverage == 'true' && github.event_name == 'push' }}
run: |
uv pip install cpp-coveralls
coveralls --exclude tests --root . --build-root build --gcov-options '\-lpbc'