-
Notifications
You must be signed in to change notification settings - Fork 204
269 lines (243 loc) · 9.19 KB
/
run-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
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
257
258
259
260
261
262
263
264
265
266
267
268
269
#
# Copyright 2020 - 2022 Free Software Foundation, Inc.
#
# This file is part of VOLK
#
# SPDX-License-Identifier: LGPL-3.0-or-later
#
name: Run VOLK tests
on: [push, pull_request]
jobs:
build-ubuntu:
name: Build on ${{ matrix.compiler.distro }} ${{ matrix.compiler.name }}
strategy:
fail-fast: false
matrix:
compiler:
- { name: g++-9, cc: gcc-9, cxx: g++-9, distro: ubuntu-20.04 }
- { name: g++-10, cc: gcc-10, cxx: g++-10, distro: ubuntu-20.04 }
- { name: g++-11, cc: gcc-11, cxx: g++-11, distro: ubuntu-22.04 }
- { name: g++-12, cc: gcc-12, cxx: g++-12, distro: ubuntu-22.04 }
- { name: g++-13, cc: gcc-13, cxx: g++-13, distro: ubuntu-24.04 }
- { name: g++-14, cc: gcc-14, cxx: g++-14, distro: ubuntu-24.04 }
- { name: clang-10, cc: clang-10, cxx: clang++-10, distro: ubuntu-20.04 }
- { name: clang-11, cc: clang-11, cxx: clang++-11, distro: ubuntu-20.04 }
- { name: clang-12, cc: clang-12, cxx: clang++-12, distro: ubuntu-22.04 }
- { name: clang-13, cc: clang-13, cxx: clang++-13, distro: ubuntu-22.04 }
- { name: clang-14, cc: clang-14, cxx: clang++-14, distro: ubuntu-22.04 }
- { name: clang-15, cc: clang-15, cxx: clang++-15, distro: ubuntu-22.04 }
- { name: clang-16, cc: clang-16, cxx: clang++-16, distro: ubuntu-24.04 }
- { name: clang-17, cc: clang-17, cxx: clang++-17, distro: ubuntu-24.04 }
- { name: clang-18, cc: clang-18, cxx: clang++-18, distro: ubuntu-24.04 }
runs-on: ${{ matrix.compiler.distro }}
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Install dependencies
run: sudo apt install python3-mako liborc-dev libgtest-dev libfmt-dev ${{ matrix.compiler.name }}
- name: Configure
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
run: mkdir build && cd build && cmake -DCMAKE_CXX_FLAGS="-Werror" -DBUILD_EXECUTABLE=ON ..
- name: Build
run: |
echo "Build with $(nproc) thread(s)"
cmake --build build -j$(nproc)
- name: Print info
run: |
./build/cpu_features/list_cpu_features
./build/apps/volk-config-info --alignment
./build/apps/volk-config-info --avail-machines
./build/apps/volk-config-info --all-machines
./build/apps/volk-config-info --malloc
./build/apps/volk-config-info --cc
- name: Test
run: |
cd build
ctest -V
build-ubuntu-arm:
# The host should always be linux
# see: https://github.com/uraimo/run-on-arch-action
runs-on: ubuntu-latest
name: Build on ${{ matrix.distro }} ${{ matrix.arch }} ${{ matrix.compiler.name }}
# Run steps on a matrix of compilers and possibly archs.
strategy:
fail-fast: false
matrix:
include:
- arch: aarch64
distro: ubuntu20.04
compiler: { name: g++-9, cc: gcc-9, cxx: g++-9 }
- arch: aarch64
distro: ubuntu20.04
compiler: { name: g++-10, cc: gcc-10, cxx: g++-10 }
- arch: aarch64
distro: ubuntu22.04
compiler: { name: g++-12, cc: gcc-12, cxx: g++-12 }
- arch: aarch64
distro: ubuntu20.04
compiler: { name: clang-9, cc: clang-9, cxx: clang++-9 }
- arch: aarch64
distro: ubuntu20.04
compiler: { name: clang-10, cc: clang-10, cxx: clang++-10 }
- arch: aarch64
distro: ubuntu22.04
compiler: { name: clang-14, cc: clang-14, cxx: clang++-14 }
- arch: aarch64
distro: ubuntu22.04
compiler: { name: clang-15, cc: clang-15, cxx: clang++-15 }
- arch: armv7
distro: ubuntu22.04
compiler: { name: g++, cc: gcc, cxx: g++ }
cmakeargs: "-DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchains/arm_cortex_a72_hardfp_native.cmake"
- arch: ppc64le
distro: ubuntu22.04
compiler: { name: g++-12, cc: gcc-12, cxx: g++-12 }
- arch: s390x
distro: ubuntu22.04
compiler: { name: g++-12, cc: gcc-12, cxx: g++-12 }
# It would be really nice to test on Risc-V but that'll take time.
- arch: riscv64
distro: ubuntu22.04
compiler: { name: g++-12, cc: gcc-12, cxx: g++-12 }
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: uraimo/run-on-arch-action@v2
name: Build in non-x86 container
id: build
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
# Not required, but speeds up builds
githubToken: ${{ github.token }}
setup: |
mkdir -p "${PWD}/build"
dockerRunArgs: |
--volume "${PWD}:/volk"
env: | # YAML, but pipe character is necessary
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
shell: /bin/sh
install: |
case "${{ matrix.distro }}" in
ubuntu*|jessie|stretch|buster)
apt-get update -q -y
apt-get install -q -y git cmake python3-mako liborc-dev libgtest-dev libfmt-dev ${{ matrix.compiler.name }}
;;
fedora*)
dnf -y update
dnf -y install git which
;;
esac
run: |
cd /volk
cd build
cmake -DCMAKE_CXX_FLAGS="-Werror" -DBUILD_EXECUTABLE=ON ${{ matrix.cmakeargs }} ..
echo "Build with $(nproc) thread(s)"
make -j$(nproc)
if [ -f ./cpu_features/list_cpu_features ]; then
./cpu_features/list_cpu_features
fi
./apps/volk-config-info --alignment
./apps/volk-config-info --avail-machines
./apps/volk-config-info --all-machines
./apps/volk-config-info --malloc
./apps/volk-config-info --cc
ctest -V
build-ubuntu-static:
name: Build static on ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: dependencies
run: sudo apt install python3-mako liborc-dev libgtest-dev libfmt-dev
- name: configure
run: mkdir build && cd build && cmake -DENABLE_STATIC_LIBS=True -DBUILD_EXECUTABLE=ON ..
- name: build
run: cmake --build build -j$(nproc)
- name: Print info
run: |
./build/cpu_features/list_cpu_features
./build/apps/volk-config-info --alignment
./build/apps/volk-config-info --avail-machines
./build/apps/volk-config-info --all-machines
./build/apps/volk-config-info --malloc
./build/apps/volk-config-info --cc
- name: test
run: cd build && ctest -V
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: dependencies
run: pip install mako
- name: configure
run: mkdir build && cd build && cmake ..
- name: build
run: cmake --build build --config Release --target INSTALL -j4
- name: test
run: cd build && ctest -V -C Release
# build-windows-msys2:
# name: Build on windows-latest using MinGW and MSYS2
# runs-on: windows-latest
# steps:
# - uses: msys2/setup-msys2@v2
# with:
# update: true
# install: >-
# base-devel
# git
# mingw-w64-x86_64-gcc-libs
# mingw-w64-x86_64-orc
# python
# python-mako
# python-six
# mingw-w64-x86_64-gcc
# mingw-w64-x86_64-cmake
# - uses: actions/checkout@v4
# - name: Checkout submodules
# run: git submodule update --init --recursive
# - name: Configure
# shell: msys2 {0}
# run: mkdir build && cd build && cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_CXX_FLAGS="-Werror" ..
# - name: Build
# shell: msys2 {0}
# run: cd build && make -j$(nproc)
# - name: Test
# shell: msys2 {0}
# run: |
# cd build
# ctest -V
build-macos:
strategy:
matrix:
os: [macos-13, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: dependencies
run: pip3 install --break-system-packages mako && brew install orc
- name: configure
run: mkdir build && cd build && cmake -DBUILD_EXECUTABLE=ON ..
- name: build
run: cmake --build build --config Debug -j4
- name: Print info
run: |
./build/cpu_features/list_cpu_features
# ./build/apps/volk-config-info --alignment
# ./build/apps/volk-config-info --avail-machines
# ./build/apps/volk-config-info --all-machines
# ./build/apps/volk-config-info --malloc
# ./build/apps/volk-config-info --cc
- name: test
run: cd build && ctest -V