Painting the Walls #50
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: Tests | |
on: | |
push: | |
branches: main | |
pull_request: | |
jobs: | |
cpp-lint: | |
name: C++ Formatting Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v3 | |
- name: Run clang-format style check | |
uses: jidicula/clang-format-action@v4.11.0 | |
with: | |
clang-format-version: '14' | |
check-path: solutions | |
py-lint: | |
name: Python Formatting Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v3 | |
- name: Run black style check | |
uses: rickstaa/action-black@v1 | |
with: | |
black_args: ". --check --diff" | |
unit-tests: | |
name: Unit Tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
type: ['RelWithDebInfo'] | |
os: ['ubuntu-20.04'] | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v3 | |
- name: Ccache | |
uses: hendrikmuhs/ccache-action@v1.1 | |
with: | |
key: ${{ matrix.os }}-${{ matrix.type }} | |
- name: Build with CMake | |
uses: lukka/run-cmake@v3 | |
with: | |
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced | |
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' | |
cmakeAppendedArgs: '-DCMAKE_BUILD_TYPE=${{ matrix.type }} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache' | |
buildWithCMake: true | |
buildDirectory: '${{ github.workspace }}/build' | |
- name: Run CTest | |
working-directory: ${{github.workspace}}/build | |
run: ctest -VVV -C ${{ matrix.type }} |