-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (52 loc) · 1.55 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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-22.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 }}