-
-
Notifications
You must be signed in to change notification settings - Fork 3
105 lines (96 loc) · 3.6 KB
/
build.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
name: build & test
env:
IMAGE_PREFIX: "ghcr.io/dnkpp/"
on:
push:
branches: [master, dev]
pull_request:
branches: [master, dev]
jobs:
build:
name: |
${{ matrix.config.prefix }}
${{ matrix.config.compiler_name }}-${{ matrix.config.compiler_version }}
${{ matrix.config.suffix }}
(C++${{ matrix.cxx_standard }}, ${{ matrix.build_mode }})
runs-on: ${{ matrix.config.os }}
container:
image: ghcr.io/dnkpp/${{ matrix.config.compiler_name }}:${{ matrix.config.compiler_version }}
strategy:
fail-fast: false
matrix:
build_mode: [Debug, Release]
cxx_standard: [20, 23]
config:
#clang-18
- {
prefix: "Linux",
suffix: "/libc++",
os: ubuntu-latest,
compiler_name: "clang",
compiler_version: 18,
libcxx: true
}
- {
prefix: "Linux",
os: ubuntu-latest,
compiler_name: "clang",
compiler_version: 18,
libcxx: false
}
#clang-17
- {
prefix: "Linux",
suffix: "/libc++",
os: ubuntu-latest,
compiler_name: "clang",
compiler_version: 17,
libcxx: true
}
- {
prefix: "Linux",
os: ubuntu-latest,
compiler_name: "clang",
compiler_version: 17,
libcxx: false
}
#gcc-14
- {
prefix: "Linux",
os: ubuntu-latest,
compiler_name: "gcc",
compiler_version: 14,
libcxx: false
}
#gcc-13
- {
prefix: "Linux",
os: ubuntu-latest,
compiler_name: "gcc",
compiler_version: 13,
libcxx: false
}
steps:
- uses: actions/checkout@v4
- name: Choose libc++
if: ${{ matrix.config.compiler_name == 'clang' && matrix.config.libcxx == true }}
run: |
echo "CXX_FLAGS=$(echo $CXX_FLAGS -stdlib=libc++)" >> $GITHUB_ENV
echo "LINK_FLAGS=$(echo $LINK_FLAGS -lc++abi)" >> $GITHUB_ENV
- name: Configure
run: |
cmake \
-D CMAKE_BUILD_TYPE=${{ matrix.build_mode }} \
-D CMAKE_VERBOSE_MAKEFILE=yes \
-D mimicpp_BUILD_TESTS=yes \
-D mimicpp_FORCED_CXX_STANDARD:STRING="${{ matrix.cxx_standard }}" \
-D CMAKE_CXX_FLAGS:STRING="${{ env.CXX_FLAGS }}" \
-D CMAKE_EXE_LINKER_FLAGS:STRING="${{ env.LINK_FLAGS }}" \
-B build -S .
- name: Build
run: |
cmake --build build -j4
- name: Run tests
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: ctest --test-dir build/test -C ${{ matrix.build_mode }} -j4