-
Notifications
You must be signed in to change notification settings - Fork 16
51 lines (41 loc) · 1.69 KB
/
compile_and_test.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
name: CMake
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]
workflow_dispatch:
env:
BUILD_TYPE: Release
defaults:
run:
shell: bash
jobs:
build_and_test:
name: Build & test TQMesh on ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
platform:
- {name: ubuntu - gcc, os: ubuntu-latest, flags: -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc}
- {name: ubuntu - clang, os: ubuntu-latest, flags: -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang}
- {name: macos - gcc, os: macos-latest, flags: -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc}
- {name: macos - clang, os: macos-latest, flags: -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang}
- {name: windows - msvc, os: windows-latest, flags: -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl}
- {name: windows - clang, os: windows-latest, flags: -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -GNinja}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Add msbuild to PATH
if: contains(matrix.platform.name, 'msvc')
uses: microsoft/setup-msbuild@v1.0.2
- name: Add ninja to PATH
if: contains(matrix.platform.name, 'windows') && !contains(matrix.platform.name, 'msvc')
uses: seanmiddleditch/gha-setup-ninja@master
- name: Compile a release build of TQMesh
run: |
cmake -S . -B bin ${{ matrix.platform.flags }} -DCMAKE_BUILD_TYPE=$BUILD_TYPE
cmake --build bin -j2
cmake --install bin
- name: Run all of TQMesh tests
run: ./scripts/test_tqmesh.sh