2021-10-09 23:15:08 +02:00
|
|
|
name: "Unit Tests"
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
2022-06-29 00:24:53 +02:00
|
|
|
workflow_dispatch:
|
2021-10-09 23:15:08 +02:00
|
|
|
|
|
|
|
jobs:
|
2021-10-09 23:30:35 +02:00
|
|
|
tests:
|
|
|
|
name: 🧪 Unit Tests
|
2022-06-25 12:19:59 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2021-10-09 23:15:08 +02:00
|
|
|
permissions:
|
|
|
|
actions: read
|
|
|
|
contents: read
|
|
|
|
security-events: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: 🧰 Checkout
|
2022-06-23 23:48:02 +02:00
|
|
|
uses: actions/checkout@v3
|
2021-10-09 23:15:08 +02:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
2022-10-10 20:37:00 +02:00
|
|
|
- name: 📜 Setup ccache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
2021-10-09 23:15:08 +02:00
|
|
|
with:
|
2023-01-13 00:10:28 +01:00
|
|
|
key: ${{ runner.os }}-tests-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
|
|
|
|
restore-keys: ${{ runner.os }}-tests-${{ secrets.CACHE_VERSION }}-build
|
2022-10-10 20:37:00 +02:00
|
|
|
max-size: 50M
|
2023-01-30 10:42:07 +01:00
|
|
|
|
2021-10-09 23:15:08 +02:00
|
|
|
|
2022-06-29 00:24:53 +02:00
|
|
|
- name: 📜 Restore CMakeCache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
build/CMakeCache.txt
|
2023-01-13 00:10:28 +01:00
|
|
|
key: ${{ runner.os }}-tests-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
2023-01-30 10:42:07 +01:00
|
|
|
|
2021-10-09 23:15:08 +02:00
|
|
|
- name: ⬇️ Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo bash dist/get_deps_debian.sh
|
|
|
|
|
|
|
|
- name: 🛠️ Build
|
|
|
|
run: |
|
|
|
|
mkdir -p build
|
|
|
|
cd build
|
2022-08-15 23:33:04 +02:00
|
|
|
CC=gcc-12 CXX=g++-12 cmake \
|
2022-08-15 23:49:42 +02:00
|
|
|
-DCMAKE_BUILD_TYPE=Debug \
|
2022-08-15 23:33:04 +02:00
|
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
|
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
|
|
|
-DCMAKE_C_FLAGS="-fuse-ld=lld -fsanitize=address,leak,undefined -fno-sanitize-recover=all" \
|
|
|
|
-DCMAKE_CXX_FLAGS="-fuse-ld=lld -fsanitize=address,leak,undefined -fno-sanitize-recover=all" \
|
|
|
|
-DIMHEX_OFFLINE_BUILD=ON \
|
2021-10-09 23:15:08 +02:00
|
|
|
..
|
2023-01-13 00:32:17 +01:00
|
|
|
make -j4 unit_tests
|
2021-10-09 23:15:08 +02:00
|
|
|
|
|
|
|
- name: 🧪 Perform Unit Tests
|
|
|
|
run: |
|
|
|
|
cd build
|
2022-08-15 23:49:42 +02:00
|
|
|
ctest --output-on-failure
|