From 4a57f139c4c8364ddd78ec3dbbdce67cbfbdce3c Mon Sep 17 00:00:00 2001 From: Senichenkov Date: Wed, 27 Nov 2024 21:26:55 +0300 Subject: [PATCH] Run clang and gcc tests in separate actions in CI --- .../download-libraries/action.yml | 19 ++++++++++++- .github/workflows/core-tests.yml | 28 +++++++++++++++---- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/.github/composite-actions/download-libraries/action.yml b/.github/composite-actions/download-libraries/action.yml index 2c6d20353..b5d5ad92e 100644 --- a/.github/composite-actions/download-libraries/action.yml +++ b/.github/composite-actions/download-libraries/action.yml @@ -16,6 +16,16 @@ inputs: description: 'Install boost' default: true + install-clang: + type: boolean + description: 'Install clang' + default: false + + install-gcc: + type: boolean + description: 'Install gcc' + default: true + runs: using: 'composite' steps: @@ -23,8 +33,14 @@ runs: - name: Install build tools run: | sudo apt-get update -y - sudo apt-get install gcc-10 g++-10 cmake build-essential -y + sudo apt-get install cmake build-essential -y + shell: bash + + - name: Install GCC + run: | + sudo apt-get install gcc-10 g++-10 -y shell: bash + if: inputs.install-gcc != 'false' - name: Install clang run: | @@ -32,6 +48,7 @@ runs: chmod +x llvm.sh sudo ./llvm.sh 18 shell: bash + if: inputs.install-clang != 'false' - name: Make lib directory run: | diff --git a/.github/workflows/core-tests.yml b/.github/workflows/core-tests.yml index 7c29d0d6d..b5ac07390 100644 --- a/.github/workflows/core-tests.yml +++ b/.github/workflows/core-tests.yml @@ -27,7 +27,7 @@ on: #- examples/** workflow_dispatch: jobs: - run_tests: + run_tests_gcc: runs-on: ubuntu-latest strategy: matrix: @@ -42,25 +42,43 @@ jobs: uses: ./.github/composite-actions/download-libraries - name: Download datasets uses: ./.github/composite-actions/download-datasets - - name: Build (GCC) + - name: Build run: | if [[ "${{matrix.cfg.BUILD_TYPE}}" == "Debug" ]]; then ./build.sh --debug --sanitizer=${{ matrix.cfg.SANITIZER }} --compiler=g++-10 --c-compiler=gcc-10 else ./build.sh fi - - name: Test (GCC) + - name: Test working-directory: ${{github.workspace}}/build/target shell: bash run: ./Desbordante_test --gtest_filter='*:-*HeavyDatasets*' - - name: Build (Clang) + run_tests_clang: + runs-on: ubuntu-latest + strategy: + matrix: + cfg: + - { BUILD_TYPE: Release } + - { BUILD_TYPE: Debug } + - { BUILD_TYPE: Debug, SANITIZER : ADDRESS } + - { BUILD_TYPE: Debug, SANITIZER : UB } + steps: + - uses: actions/checkout@v3 + - name: Download libraries + uses: ./.github/composite-actions/download-libraries + with: + install-clang: true + install-gcc: false + - name: Download datasets + uses: ./.github/composite-actions/download-datasets + - name: Build run: | if [[ "${{matrix.cfg.BUILD_TYPE}}" == "Debug" ]]; then ./build.sh --debug --sanitizer=${{ matrix.cfg.SANITIZER }} --compiler=clang++-18 --c-compiler=clang-18 else ./build.sh fi - - name: Test (Clang) + - name: Test working-directory: ${{github.workspace}}/build/target shell: bash run: ./Desbordante_test --gtest_filter='*:-*HeavyDatasets*'