2021-10-09 23:15:08 +02:00
|
|
|
name: "Unit Tests"
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
2021-10-09 23:30:35 +02:00
|
|
|
tests:
|
|
|
|
name: 🧪 Unit Tests
|
2021-10-09 23:15:08 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
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
|
|
|
|
|
|
|
|
- name: 📜 Restore cache
|
2022-06-23 23:48:02 +02:00
|
|
|
uses: actions/cache@v3
|
2021-10-09 23:15:08 +02:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.ccache
|
2022-01-15 00:14:12 +01:00
|
|
|
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
|
|
|
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
|
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-06-23 23:48:02 +02:00
|
|
|
CC=gcc-11 CXX=g++-11 cmake \
|
2022-01-13 21:31:01 +01:00
|
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
2021-10-09 23:15:08 +02:00
|
|
|
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
|
2022-01-13 21:31:01 +01:00
|
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
|
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
|
|
|
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
|
|
|
|
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
|
2021-10-09 23:15:08 +02:00
|
|
|
..
|
2021-12-14 21:26:59 +01:00
|
|
|
make -j4 unit_tests install
|
2021-10-09 23:15:08 +02:00
|
|
|
|
|
|
|
- name: 🧪 Perform Unit Tests
|
|
|
|
run: |
|
|
|
|
cd build
|
|
|
|
ctest
|