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
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: 📜 Restore cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
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-01-13 21:31:01 +01:00
|
|
|
CC=gcc-10 CXX=g++-10 cmake \
|
|
|
|
-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
|