-
Notifications
You must be signed in to change notification settings - Fork 5
67 lines (55 loc) · 2.1 KB
/
test_clang_linux.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
name: clang linux
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '20 3 * * *'
env:
TEST_DIR: ./tests
jobs:
all:
strategy:
fail-fast: false
matrix:
clang_version: [13, 15]
cpp_version: [c++17, c++20]
stdlib: [libc++, libstdc++] # llvm library and gcc library
arch: [m64, m32] # 64 and 32 bit
buildmode: [~ , -O3 -DNDEBUG, -O3 -DNDEBUG -ffast-math]
# Also include a few variations with disabled UB tricks (not for all to limit resource consumption).
include:
- clang_version: 15
cpp_version: c++20
stdlib: libc++
arch: m64
buildmode: -DTINY_OPTIONAL_USE_SEPARATE_BOOL_INSTEAD_OF_UB_TRICKS
- clang_version: 15
cpp_version: c++20
stdlib: libstdc++
arch: m64
buildmode: -DTINY_OPTIONAL_USE_SEPARATE_BOOL_INSTEAD_OF_UB_TRICKS
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install libc++ if required
# libc++ is not installed for all clang versions by default.
if: ${{ matrix.stdlib == 'libc++' && matrix.arch == 'm64' }}
run: |
sudo apt update
sudo apt install ${{ format('libc++-{0}-dev libc++abi-{0}-dev', matrix.clang_version) }} -y
- name: Install gcc-multilib and libc++ for x86 if required
# For x86: We require both gcc multilib and the 32-bit variant (i386) of libc++ for the
# used clang version. For libc++ we need to manually add the i386 architecture.
if: ${{ matrix.arch == 'm32' }}
run: |
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install gcc-multilib g++-multilib ${{ format('libc++-{0}-dev:i386 libc++abi-{0}-dev:i386', matrix.clang_version) }} -y
- name: Build and run tests
working-directory: ${{env.TEST_DIR}}
env:
CXX: ${{ format('clang++-{0}', matrix.clang_version) }}
ADDITIONAL_FLAGS: ${{ format('-{0} -std={1} -stdlib={2} {3}', matrix.arch, matrix.cpp_version, matrix.stdlib, matrix.buildmode) }}
run: make generic