Build and run tests in a dev container #414
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
code-style-check: | |
name: Code style check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: DoozyX/clang-format-lint-action@v0.13 | |
with: | |
source: '.' | |
exclude: './thirdparty ./docs' | |
extensions: 'hpp,cpp' | |
clangFormatVersion: 12 | |
ubuntu-gcc: | |
name: Ubuntu GCC build & test | |
runs-on: ubuntu-latest | |
needs: code-style-check | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Cache LLVM and Clang | |
id: cache-llvm | |
uses: actions/cache@v2 | |
with: | |
path: ./llvm | |
key: llvm-13.0.0 | |
- name: Install LLVM and Clang | |
uses: KyleMayes/install-llvm-action@v1 | |
with: | |
version: "13.0.0" | |
cached: ${{ steps.cache-llvm.outputs.cache-hit }} | |
- name: Build | |
run: | | |
mkdir build && cd build | |
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. | |
make | |
- name: Run tests | |
run: | | |
cd build | |
ctest --output-on-failure | |
windows-msvc: | |
name: Windows MSVC build & test | |
runs-on: windows-2022 | |
needs: code-style-check | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Build | |
run: | | |
md build && cd build | |
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DENABLE_IR_GENERATOR=OFF .. | |
cmake --build . | |
- name: Run tests | |
run: | | |
cd build | |
ctest --output-on-failure |