-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (74 loc) · 2.34 KB
/
Copy pathbuild.yml
File metadata and controls
90 lines (74 loc) · 2.34 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Compile & Test
permissions:
actions: write
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
env:
BUILD_TYPE: Debug
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc, clang, clang-libc++]
name: ${{ matrix.compiler }}
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Install toolchain
id: install-toolchain
uses: stormbytepp/githubactions/.github/actions/install-toolchain@master
with:
toolchain: ${{ matrix.compiler }}
ccache-key: ${{ matrix.compiler }}-v1
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build with CMake
uses: ashutoshvarma/action-cmake-build@master
with:
build-dir: ${{ github.workspace }}/build
cc: ${{ steps.install-toolchain.outputs.c_compiler }}
cxx: ${{ steps.install-toolchain.outputs.cxx_compiler }}
configure-options: >-
-G Ninja
-DENABLE_ASAN=ON
-DENABLE_TEST=ON
${{ matrix.compiler == 'clang-libc++' && format('-DCMAKE_CXX_FLAGS=-stdlib={0}', 'libc++') || '' }}
run-test: true
ctest-options: --output-on-failure --test-dir ${{ github.workspace }}/build/test
build-type: ${{ env.BUILD_TYPE }}
build-windows:
runs-on: windows-latest
strategy:
matrix:
arch:
- x64
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: true
- name: Install toolchain
id: install-toolchain
uses: stormbytepp/githubactions/.github/actions/install-toolchain@master
with:
toolchain: msvc
- name: Build with CMake
uses: ashutoshvarma/action-cmake-build@master
with:
build-dir: ${{ github.workspace }}\build
configure-options: >-
-G Ninja
-DENABLE_TEST=ON
build-type: ${{ env.BUILD_TYPE }}
- name: Add DLL directory to PATH
run: echo "${{ github.workspace }}\build\lib" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Run unit tests
run: ctest --output-on-failure --test-dir ${{ github.workspace }}\build\test