-
Notifications
You must be signed in to change notification settings - Fork 165
256 lines (245 loc) · 7.89 KB
/
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
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
244
245
246
247
248
249
250
251
252
253
254
255
256
name: Test
on: [push, pull_request]
jobs:
makefile-analysis:
name: makefile-analysis
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: "Install analysis tools"
run: |
sudo apt-get update
sudo apt-get install -y clang-tools valgrind
- name: Run tests
run: ./test/ci/analysis.sh
makefile-test:
name: makefile-${{ matrix.runner }}-amd64-${{ matrix.compiler }} ${{ ((matrix.openmp == 1) && '+openmp') || '' }}
needs: makefile-analysis
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner: ["ubuntu-20.04"]
compiler: ["gcc", "clang"]
openmp: ["0", "1"]
include:
- runner: "macos-12"
compiler: "clang"
openmp: "0"
env:
OPENMP: ${{ matrix.openmp }}
OMP_NUM_THREADS: ${{ ((matrix.openmp == 1) && '2') || '0' }}
CC: ${{ matrix.compiler }}
OBJCOPY: ${{ (startsWith(matrix.runner, 'macos') && 'echo') || 'objcopy' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run tests
run: ./test/ci/test.sh
cmake-test:
name: cmake-${{ matrix.runner }}-${{ matrix.platform }}
needs: makefile-analysis
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner: ["ubuntu-20.04", "windows-2019"]
platform: ["x86_64", "i686"]
include:
- runner: "macos-12"
platform: "x86_64"
- runner: "macos-14"
platform: "arm64"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Ubuntu i686 support
if: runner.os == 'Linux' && matrix.platform == 'i686'
run: |
sudo apt-get update
sudo apt-get install -y libc6-dev-i386
echo "CFLAGS=-m32" >> $GITHUB_ENV
echo "LDFLAGS=-m32" >> $GITHUB_ENV
- name: CMake Configure
run: >
cmake
-B out
-Werror=dev
-DBASE64_BUILD_TESTS=ON
${{ runner.os != 'Windows' && '-DCMAKE_BUILD_TYPE=Release' || '' }}
${{ runner.os == 'Windows' && matrix.platform == 'i686' && '-A Win32' || '' }}
- name: CMake Build
run: cmake --build out --config Release --verbose
- name: CTest
run: ctest --no-tests=error --test-dir out -VV --build-config Release
env:
BASE64_TEST_SKIP_AVX512: "1"
alpine-makefile-test:
name: makefile-alpine-amd64-gcc
needs: makefile-analysis
runs-on: ubuntu-latest
container:
image: alpine:3.12
env:
CC: gcc
steps:
- name: Install deps
run: apk add --update bash build-base git
- name: Checkout
uses: actions/checkout@v4
- name: Run tests
run: ./test/ci/test.sh
alpine-cmake-test:
name: cmake-alpine-amd64-gcc
needs: makefile-analysis
runs-on: ubuntu-latest
container:
image: alpine:3.12
steps:
- name: Install deps
run: apk add --update bash build-base cmake git
- name: Checkout
uses: actions/checkout@v4
- name: CMake Configure
run: >
cmake
-B out
-Werror=dev
-DBASE64_BUILD_TESTS=ON
-DCMAKE_BUILD_TYPE=Release
- name: CMake Build
run: cmake --build out --config Release --verbose
- name: CTest
run: ctest --no-tests=error -VV --build-config Release
working-directory: ./out
env:
BASE64_TEST_SKIP_AVX512: "1"
alpine-alt-arch-makefile-test:
name: makefile-alpine-${{matrix.arch}}-${{matrix.cc}}
needs: makefile-analysis
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [armv7, aarch64, s390x, ppc64le]
cc: [gcc, clang]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: uraimo/run-on-arch-action@v2
with:
arch: ${{matrix.arch}}
distro: alpine_latest
env: |
CC: ${{matrix.cc}}
install: apk add --update bash build-base cmake git ${{matrix.cc}}
run: ./test/ci/test.sh
alpine-alt-arch-cmake-test:
name: cmake-alpine-${{matrix.arch}}-${{matrix.cc}}
needs: makefile-analysis
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [armv7, aarch64, s390x, ppc64le]
cc: [gcc, clang]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: uraimo/run-on-arch-action@v2
with:
arch: ${{matrix.arch}}
distro: alpine_latest
env: |
CC: ${{matrix.cc}}
install: apk add --update bash build-base cmake git ${{matrix.cc}}
run: |
echo "::group::CMake Configure"
cmake -B out -Werror=dev -DBASE64_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release
echo "::endgroup::CMake Configure"
echo "::group::CMake Build"
cmake --build out --config Release --verbose
echo "::endgroup::CMake Build"
echo "::group::CTest"
ctest --no-tests=error --test-dir out -VV --build-config Release
echo "::endgroup::CTest"
msys2-cmake-test:
name: msys2-cmake-${{ matrix.msystem }}
needs: makefile-analysis
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- { msystem: msys, toolchain: "gcc" }
- { msystem: mingw32, env: mingw-w64-i686- }
- { msystem: mingw64, env: mingw-w64-x86_64- }
- { msystem: ucrt64, env: mingw-w64-ucrt-x86_64- }
- { msystem: clang32, env: mingw-w64-clang-i686- }
- { msystem: clang64, env: mingw-w64-clang-x86_64- }
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup MSYS2 ${{matrix.msystem}}
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.msystem}}
update: true
install: >-
make
${{ matrix.env }}${{ matrix.toolchain || 'toolchain' }}
${{ matrix.env }}cmake
- name: CMake Configure
shell: msys2 {0}
run: >
cmake
-B out
-Werror=dev
-DBASE64_BUILD_TESTS=ON
-DCMAKE_BUILD_TYPE=Release
- name: CMake Build
shell: msys2 {0}
run: cmake --build out --config Release --verbose
- name: CTest
shell: msys2 {0}
run: ctest --no-tests=error --test-dir out -VV --build-config Release
env:
BASE64_TEST_SKIP_AVX512: "1"
- name: Test demo utility with unicode filenames and file contents on Windows
shell: msys2 {0}
run: |
out/bin/base64 test/ci/😵💫.bin > test/ci/😵💫.bin.b64
out/bin/base64 -d test/ci/😵💫.bin.b64 > test/ci/😵💫.bin
cd test/ci
sha256sum -c checksums.txt
msys2-makefile-test:
name: msys2-makefile-${{ matrix.msystem }}
needs: makefile-analysis
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- { msystem: msys, toolchain: "gcc" }
- { msystem: mingw32, env: mingw-w64-i686- }
- { msystem: mingw64, env: mingw-w64-x86_64- }
- { msystem: ucrt64, env: mingw-w64-ucrt-x86_64- }
# - { msystem: clang32, env: mingw-w64-clang-i686- } disabled, lld does not support the "-r" option
# - { msystem: clang64, env: mingw-w64-clang-x86_64- } disabled, lld does not support the "-r" option
env:
CC: cc.exe
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup MSYS2 ${{matrix.msystem}}
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.msystem}}
update: true
install: >-
make
${{ matrix.env }}${{ matrix.toolchain || 'toolchain' }}
- name: Run tests
shell: msys2 {0}
run: ./test/ci/test.sh