consolidate tests to be runable from build path #166
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 libslurm-dev | |
# run: sudo apt-get install util-linux libmount-dev slurm-wlm libslurm-dev slurmd slurmctld slurm-client | |
# disable for now, because the cache has never actually worked | |
# ironically, this means that it slows down the build | |
#- 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 | |
- 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: install squashfs-mount | |
run: | | |
wget https://github.com/eth-cscs/squashfs-mount/archive/refs/tags/v1.1.0.tar.gz | |
tar -xzf v1.1.0.tar.gz | |
./meson/meson setup build-sqfs squashfs-mount-1.1.0 | |
./meson/meson compile -C build-sqfs | |
sudo ./meson/meson install -C build-sqfs | |
- name: Configure | |
run: | | |
CC="gcc-12" CXX="g++-12" ./meson/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: | | |
sudo mkdir /user-tools /user-environment | |
./meson/meson test -Cbuild --verbose cli |