From 9b3822a8bd2a994784f54ae2a650e9a66d28b86e Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 9 Oct 2021 23:15:08 +0200 Subject: [PATCH] git: CodeQL doesn't need to run every commit. And also not only at 00:21 every thursday... --- .github/workflows/analysis.yml | 21 ++++---------- .github/workflows/tests.yml | 52 ++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index e329b6b8c..8822e9095 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -1,12 +1,8 @@ -name: "CodeQL and Unit Tests" +name: "CodeQL" on: - push: - branches: [ master ] - pull_request: - branches: [ master ] schedule: - - cron: '21 0 * * 2' + - cron: '0 0 * * *' jobs: analyze: @@ -34,8 +30,8 @@ jobs: with: path: | ~/.ccache - .flatpak-builder - key: ${{ runner.os }}-build + key: ${{ runner.os }}-build-${{ github.run_id }} + restore-keys: ${{ runner.os }}-build- - name: โฌ‡๏ธ Install dependencies run: | @@ -44,19 +40,14 @@ jobs: - name: ๐Ÿ› ๏ธ Build run: | - mkdir build + mkdir -p build cd build CC=gcc-10 CXX=g++-10 cmake \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ -DCMAKE_INSTALL_PREFIX="$PWD/install" \ - -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ .. make -j 4 install - - name: ๐Ÿงช Perform Unit Tests - run: | - cd build - ctest - - name: ๐Ÿ—ฏ๏ธ Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..f21f053f1 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,52 @@ +name: "Unit Tests" + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + analyze: + name: ๐Ÿ› Analyze + 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 + key: ${{ runner.os }}-build-${{ github.run_id }} + restore-keys: ${{ runner.os }}-build- + + - name: โฌ‡๏ธ Install dependencies + run: | + sudo apt update + sudo bash dist/get_deps_debian.sh + + - name: ๐Ÿ› ๏ธ Build + run: | + mkdir -p build + cd build + CC=gcc-10 CXX=g++-10 cmake \ + -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ + -DCMAKE_INSTALL_PREFIX="$PWD/install" \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + .. + make -j 4 install + + - name: ๐Ÿงช Perform Unit Tests + run: | + cd build + ctest \ No newline at end of file