consolidate tests to be runable from build path #155
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: | |
merge_group: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
build-and-test: | |
strategy: | |
matrix: | |
buildtype: [debug, release] | |
sanitizer: [none, address, leak, undefined, thread] | |
exclude: | |
# False positive warnings in release builds: https://godbolt.org/z/vT3nqGxzW | |
- buildtype: release | |
sanitizer: address | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Update apt repositories for ccache | |
run: sudo apt update | |
- name: Install dependencies | |
run: sudo apt-get install util-linux libmount-dev slurm-wlm libslurm-dev slurmd slurmctld slurm-client | |
- name: Set up ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: ccache-linux-${{ matrix.buildtype }}-${{ matrix.sanitizer }} | |
- name: Install compiler and build tools | |
run: sudo apt install --no-install-recommends --yes g++-12 ninja-build | |
#run: sudo apt install --no-install-recommends --yes g++-12 meson ninja-build | |
- name: install meson | |
run: | | |
wget https://github.com/mesonbuild/meson/releases/download/1.6.1/meson-1.6.1.tar.gz && \ | |
tar -xzf meson-1.6.1.tar.gz && \ | |
mv meson-1.6.1 meson && \ | |
mv meson/meson.py meson/meson | |
- name: Configure | |
run: CXX="ccache g++-12" PATH=$(pwd)/meson:$PATH \ | |
meson setup \ | |
--buildtype ${{ matrix.buildtype }} \ | |
-Db_sanitize=${{ matrix.sanitizer }} \ | |
-Dtests=enabled \ | |
--warnlevel 3 \ | |
--werror \ | |
build . | |
- name: Build | |
run: ./meson/meson compile -Cbuild | |
- name: test unit | |
run: ./meson/meson test -Cbuild --verbose unit | |
- name: test cli | |
run: ./meson/meson test -Cbuild --verbose cli |