forked from cpputest/cpputest
-
Notifications
You must be signed in to change notification settings - Fork 0
243 lines (229 loc) · 7.1 KB
/
basic.yml
File metadata and controls
243 lines (229 loc) · 7.1 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
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
---
name: Basic builds
"on":
push:
pull_request:
jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- uses: DoozyX/clang-format-lint-action@v0.14
with:
clangFormatVersion: 14
source: examples
automake:
strategy:
matrix:
include:
# Mac OSX
- os: macos-latest
cc: gcc
cxx: g++
- os: macos-latest
cc: clang
cxx: clang++
# Linux
- os: ubuntu-latest
cc: gcc
cxx: g++
- os: ubuntu-latest
cc: clang
cxx: clang++
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@main
- run: brew install automake
if: ${{ startswith(matrix.os, 'macos') }}
- if: ${{ matrix.cxx }}
run: echo "CXX=${{ matrix.cxx }}" >> $GITHUB_ENV
- if: ${{ matrix.cc }}
run: echo "CC=${{ matrix.cc }}" >> $GITHUB_ENV
- name: Configure
run: |
autoreconf -i .
./configure
- name: Build and test
run: make tdd
cmake:
strategy:
matrix:
include:
- name: MSVC install
os: windows-latest
preset: MSVC
install: true
ctest_args: -C Debug
- name: MSVC 20
os: windows-latest
cmake_args: -DCMAKE_CXX_STANDARD=20
preset: MSVC
ctest_args: -C Debug
- name: ClangCL
os: windows-latest
cmake_args: -DCMAKE_CXX_STANDARD=17
preset: ClangCL
ctest_args: -C Debug
- name: Linux Clang 98
os: ubuntu-latest
cmake_args: -DCMAKE_CXX_STANDARD=98
preset: Clang
- name: Linux Clang 11
os: ubuntu-latest
cmake_args: -DCMAKE_CXX_STANDARD=11
preset: Clang
- name: Linux Clang 14
os: ubuntu-latest
cmake_args: -DCMAKE_CXX_STANDARD=14
preset: Clang
- name: Linux Clang 17
os: ubuntu-latest
cmake_args: -DCMAKE_CXX_STANDARD=17
preset: Clang
- name: Linux Clang 20
os: ubuntu-latest
cmake_args: -DCMAKE_CXX_STANDARD=20
preset: Clang
- name: Linux GNU 98
os: ubuntu-latest
cmake_args: -DCMAKE_CXX_STANDARD=98
preset: GNU
- name: No long long
os: ubuntu-latest
preset: no-long-long
- name: Detailed
os: ubuntu-latest
preset: detailed
- name: Linux GNU Install
os: ubuntu-latest
cmake_args: -DCMAKE_CXX_STANDARD=11
preset: GNU
install: true
- name: Linux GNU 14
os: ubuntu-latest
cmake_args: -DCMAKE_CXX_STANDARD=14
preset: GNU
- name: Linux GNU 17
os: ubuntu-latest
cmake_args: -DCMAKE_CXX_STANDARD=17
preset: GNU
- name: Linux GNU 20
os: ubuntu-latest
cmake_args: -DCMAKE_CXX_STANDARD=20
preset: GNU
- name: MinGW
os: ubuntu-latest
preset: MinGW
apt_packages: mingw-w64 wine64
- name: No C++ Standard Library
os: ubuntu-latest
preset: no-std-cpp
- name: No RTTI
os: ubuntu-latest
preset: no-rtti
- name: No Exceptions
os: ubuntu-latest
preset: no-exceptions
- name: No C Standard Library
os: ubuntu-latest
preset: no-std-c
- name: Coverage
os: ubuntu-latest
preset: coverage
apt_packages: lcov
- name: GCC ARM embedded
os: ubuntu-latest
preset: arm-embedded
- name: Mac install
os: macos-latest
preset: defaults
install: true
- name: Apple Clang 17
os: macos-latest
cmake_args: -DCMAKE_CXX_STANDARD=17
preset: Clang
- name: Apple Clang 20
os: macos-latest
cmake_args: -DCMAKE_CXX_STANDARD=20
preset: Clang
- name: Mac GNU 14
os: macos-latest
cmake_args: -DCMAKE_CXX_STANDARD=14
preset: GNU
- name: OpenWatcom DOS
os: ubuntu-latest
preset: DOS
apt_packages: dosbox
- name: Cygwin
os: windows-latest
preset: GNU
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
### SETUP
- name: Install packages
run: sudo apt install -y ${{ matrix.apt_packages }}
if: ${{ matrix.apt_packages }}
- uses: carlosperate/arm-none-eabi-gcc-action@v1
if: ${{ matrix.name == 'GCC ARM embedded' }}
- name: Install QEMU
# The version in the ubuntu repositories (6.2) is broken.
run: |
wget -nv http://ftp.de.debian.org/debian/pool/main/q/qemu/qemu-user-static_7.1+dfsg-2_amd64.deb -O qemu.deb
sudo dpkg --install qemu.deb
rm -f qemu.deb
if: ${{ matrix.name == 'GCC ARM embedded' }}
- name: Install OpenWatcom
uses: open-watcom/setup-watcom@v0
with:
version: "2.0"
if: ${{ matrix.name == 'OpenWatcom DOS' }}
- run: git config --global core.autocrlf input
if: ${{ matrix.name == 'Cygwin' }}
- name: Checkout
uses: actions/checkout@main
- name: Install Cygwin
uses: cygwin/cygwin-install-action@master
with:
platform: x86
packages: >
cmake
gcc-core
gcc-g++
make
if: ${{ matrix.name == 'Cygwin' }}
## BUILD AND TEST
- name: Configure
run: cmake --preset ${{ matrix.preset }} ${{ matrix.cmake_args }}
- name: Build
run: cmake --build cpputest_build --verbose -j
- name: Test
run: ctest --test-dir cpputest_build ${{ matrix.ctest_args }}
# POST PROCESSING
- name: Install (*nix)
run: |
sudo cmake --install cpputest_build/
pkg-config --print-provides cpputest
if: ${{ matrix.install && !startswith(matrix.os, 'windows')}}
- name: Install (Windows)
run: cmake --install cpputest_build/ --config=Debug
if: ${{ matrix.install && startswith(matrix.os, 'windows')}}
- name: Use install
run: |
cmake -B build -S examples
cmake --build build -j
ctest --test-dir build
if: ${{ matrix.install }}
- name: Coverage
run: |
lcov --capture --directory . --no-external --output-file lcov.info
lcov --remove lcov.info --output-file lcov.info '*/tests/*'
if: ${{ matrix.name == 'Coverage' }}
- name: Coveralls
uses: coverallsapp/github-action@master
with:
path-to-lcov: lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.name == 'Coverage' }}