-
Notifications
You must be signed in to change notification settings - Fork 2
190 lines (164 loc) · 6.38 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: Tests
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
tags:
- "v*"
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: false
jobs:
windows-build:
strategy:
fail-fast: false
matrix:
compiler: [{ c: "clang-cl", cxx: "clang-cl" }, { c: "cl", cxx: "cl" }]
name: Windows - ${{ matrix.compiler.cxx }}
runs-on: windows-latest
env:
triplet: x64-windows
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Configure VS Toolchain
uses: ilammy/msvc-dev-cmd@v1
- name: Install dependencies
run: vcpkg install gtest --triplet ${{ env.triplet }}
- name: Build and test
run: |
rm -rf "${{ github.workspace }}\build"
cmake -B "${{ github.workspace }}\build" -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT\\scripts\\buildsystems\\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{ env.triplet }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -G "Ninja Multi-Config"
# cmake --build "${{ github.workspace }}\build" --config Debug --clean-first
# ctest --test-dir "${{ github.workspace }}\build" -C Debug
cmake --build "${{ github.workspace }}\build" --config Release --clean-first
ctest --test-dir "${{ github.workspace }}\build" -C Release
shell: bash
ubuntu2204-build:
strategy:
fail-fast: false
matrix:
compiler:
[
{ c: "gcc-11", cxx: "g++-11" },
]
name: Ubuntu - ${{ matrix.compiler.cxx }}
runs-on: ubuntu-22.04
env:
triplet: x64-linux
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install compilers
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install ninja
- name: Install dependencies
run: vcpkg install gtest --triplet ${{ env.triplet }}
- name: Build and test
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
rm -rf ${{ github.workspace }}/build
cmake -B ${{ github.workspace }}/build -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{ env.triplet }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -G "Ninja Multi-Config"
cmake --build ${{ github.workspace }}/build --config Debug --clean-first
ctest --test-dir ${{ github.workspace }}/build -C Debug
cmake --build ${{ github.workspace }}/build --config Release --clean-first
ctest --test-dir ${{ github.workspace }}/build -C Release
ubuntu2404-build:
strategy:
fail-fast: false
matrix:
compiler:
[
{ c: "gcc-12", cxx: "g++-12" },
{ c: "gcc-12", cxx: "g++-13" },
{ c: "gcc-12", cxx: "g++-14" },
{
c: "$(brew --prefix llvm@15)/bin/clang",
cxx: "$(brew --prefix llvm@15)/bin/clang++",
},
{
c: "$(brew --prefix llvm@16)/bin/clang",
cxx: "$(brew --prefix llvm@16)/bin/clang++",
},
{
c: "$(brew --prefix llvm@17)/bin/clang",
cxx: "$(brew --prefix llvm@17)/bin/clang++",
},
{
c: "$(brew --prefix llvm@18)/bin/clang",
cxx: "$(brew --prefix llvm@18)/bin/clang++",
},
]
name: Ubuntu - ${{ matrix.compiler.cxx }}
runs-on: ubuntu-24.04
env:
triplet: x64-linux
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install compilers
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install ninja llvm@15 llvm@16 llvm@17 llvm@18
- name: Install dependencies
run: vcpkg install gtest --triplet ${{ env.triplet }}
- name: Build and test
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
rm -rf ${{ github.workspace }}/build
cmake -B ${{ github.workspace }}/build -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{ env.triplet }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -G "Ninja Multi-Config"
cmake --build ${{ github.workspace }}/build --config Debug --clean-first
ctest --test-dir ${{ github.workspace }}/build -C Debug
cmake --build ${{ github.workspace }}/build --config Release --clean-first
ctest --test-dir ${{ github.workspace }}/build -C Release
macos-build:
strategy:
fail-fast: false
matrix:
compiler:
[
{ c: "gcc-11", cxx: "g++-11" },
{ c: "gcc-12", cxx: "g++-12" },
{ c: "gcc-13", cxx: "g++-13" },
{
c: "$(brew --prefix llvm@16)/bin/clang",
cxx: "$(brew --prefix llvm@16)/bin/clang++",
},
{
c: "$(brew --prefix llvm@17)/bin/clang",
cxx: "$(brew --prefix llvm@17)/bin/clang++",
},
{
c: "$(brew --prefix llvm@18)/bin/clang",
cxx: "$(brew --prefix llvm@18)/bin/clang++",
},
]
name: MacOS - ${{ matrix.compiler.cxx }}
runs-on: macos-latest
env:
triplet: arm64-osx
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install compilers
run: brew install ninja llvm@16 llvm@17 llvm@18
- name: Install dependencies
run: |
git clone --depth=1 https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
CC=${{ matrix.compiler.c }} CXX=${{ matrix.compiler.cxx }} ./vcpkg/vcpkg install gtest --triplet ${{ env.triplet }}
- name: Build and test
run: |
rm -rf ${{ github.workspace }}/build
cmake -B ${{ github.workspace }}/build -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{ env.triplet }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -G "Ninja Multi-Config"
cmake --build ${{ github.workspace }}/build --config Debug --clean-first
ctest --test-dir ${{ github.workspace }}/build -C Debug
cmake --build ${{ github.workspace }}/build --config Release --clean-first
ctest --test-dir ${{ github.workspace }}/build -C Release