Skip to content

Commit

Permalink
use gcc and clang in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ar90n committed Jun 2, 2022
1 parent 1ade2e6 commit 8568e09
Showing 1 changed file with 35 additions and 6 deletions.
41 changes: 35 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,64 @@ env:
BUILD_TYPE: Release

jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
linux:
name: ${{ matrix.os }}.${{ matrix.compiler.compiler }}.${{ matrix.flavor }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ linux ]
compiler:
- { compiler: GNU, CC: gcc-10, CXX: g++-10, GCOV: gcov-10 }
- { compiler: LLVM, CC: clang-10, CXX: clang++-10 }
flavor: [ RelWithDebInfo, Coverage ]
exclude:
- os: linux
compiler: { compiler: LLVM, CC: clang-10, CXX: clang++-10 }
flavor: Coverage

steps:
- uses: actions/checkout@v3


- name: install packages
run: sudo apt-get install -y googletest zlib1g-dev clang++-10 g++-10

- name: install google test
run: |
sudo apt-get install -y googletest zlib1g-dev
cd /usr/src/googletest
sudo cmake .
sudo cmake -C .
sudo make
sudo make install
env:
CC: ${{ matrix.compiler.CC }}
CXX: ${{ matrix.compiler.CXX }}
GCOV: ${{ matrix.compiler.GCOV }}

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
env:
CC: ${{ matrix.compiler.CC }}
CXX: ${{ matrix.compiler.CXX }}
GCOV: ${{ matrix.compiler.GCOV }}

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
env:
CC: ${{ matrix.compiler.CC }}
CXX: ${{ matrix.compiler.CXX }}
GCOV: ${{ matrix.compiler.GCOV }}

- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}
env:
CC: ${{ matrix.compiler.CC }}
CXX: ${{ matrix.compiler.CXX }}
GCOV: ${{ matrix.compiler.GCOV }}

0 comments on commit 8568e09

Please sign in to comment.