Change license to MIT #152
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: C/C++ CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- 'README.md' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
strategy: | |
matrix: | |
compiler: | |
- { name: Clang, cc: clang, cxx: clang++ } | |
- { name: GNU, cc: gcc-10, cxx: g++-10 } | |
- { name: Intel, cc: icx, cxx: icpx } | |
build-mode: [Debug, Release] | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: install-gcc | |
if: matrix.compiler.name == 'GNU' | |
run: | | |
sudo apt-get install -y gcc-10 | |
- name: export-compiler | |
run: | | |
echo CXX=${{ matrix.compiler.cxx }} >> $GITHUB_ENV | |
echo CC=${{ matrix.compiler.cc }} >> $GITHUB_ENV | |
- name: setup-intel-oneapi | |
if: matrix.compiler.name == 'Intel' | |
run: | | |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
sudo echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | |
sudo apt-get update | |
sudo apt-get install -y intel-oneapi-common-vars | |
- name: install-icc | |
if: matrix.compiler.name == 'Intel' | |
run: | | |
sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic | |
- name: source-intel-vars | |
if: matrix.compiler.name == 'Intel' | |
run: | | |
source /opt/intel/oneapi/setvars.sh | |
printenv >> $GITHUB_ENV | |
- name: print-compiler-version | |
run: | | |
$CC --version | |
$CXX --version | |
- name: cpu-cores | |
uses: SimenB/github-actions-cpu-cores@v1 | |
id: cpu-cores | |
- name: print-cpu-cores | |
run: echo ${{ steps.cpu-cores.outputs.count }} | |
- name: cmake | |
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build-mode }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_C_COMPILER=${{ matrix.compiler.cc }} -DKASSERT_WARNINGS_ARE_ERRORS=On -DKASSERT_BUILD_TESTS=On | |
- name: build | |
run: cmake --build build/ --parallel ${{ steps.cpu-cores.outputs.count }} | |
- name: run tests | |
run: ctest --output-on-failure --parallel ${{ steps.cpu-cores.outputs.count }} --test-dir build/ |