Skip to content

Commit

Permalink
Run clang and gcc tests in separate actions in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Petua41 committed Nov 27, 2024
1 parent 3e88939 commit 9983606
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
13 changes: 12 additions & 1 deletion .github/composite-actions/download-libraries/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,33 @@ inputs:
description: 'Install boost'
default: true

install-clang:
type: boolean
description: 'Install clang'
default: false

runs:
using: 'composite'
steps:
- uses: actions/checkout@v3
- 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 gcc-10 g++-10 build-essential -y
shell: bash
# gcc-12, which comes with build-essential somehow breaks clang
if: inputs.install-clang != 'true'

- name: Install clang
# llvm.sh installs all needed libraries
run: |
sudo apt-get update -y
sudo apt-get install cmake make -y
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
shell: bash
if: inputs.install-clang != 'false'

- name: Make lib directory
run: |
Expand Down
27 changes: 22 additions & 5 deletions .github/workflows/core-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
#- examples/**
workflow_dispatch:
jobs:
run_tests:
run_tests_gcc:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -42,25 +42,42 @@ 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
- 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*'

0 comments on commit 9983606

Please sign in to comment.