name: "Unit Tests" on: push: branches: [ master ] pull_request: branches: [ master ] workflow_dispatch: jobs: tests: name: ๐Ÿงช Unit Tests runs-on: ubuntu-22.04 permissions: actions: read contents: read security-events: write steps: - name: ๐Ÿงฐ Checkout uses: actions/checkout@v3 with: submodules: recursive - name: ๐Ÿ“œ Restore ccache uses: actions/cache@v3 with: path: | ~/.cache/ccache key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }} restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build - name: ๐Ÿ“œ Restore CMakeCache uses: actions/cache@v3 with: path: | build/CMakeCache.txt key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }} - name: โฌ‡๏ธ Install dependencies run: | sudo apt update sudo bash dist/get_deps_debian.sh - name: ๐Ÿ› ๏ธ Build run: | mkdir -p build cd build CC=gcc-12 CXX=g++-12 cmake \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ -DCMAKE_INSTALL_PREFIX="$PWD/install" \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_FLAGS="-fuse-ld=lld" \ -DCMAKE_CXX_FLAGS="-fuse-ld=lld" \ .. make -j4 unit_tests install - name: ๐Ÿงช Perform Unit Tests run: | cd build ctest