-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (107 loc) · 4.06 KB
/
run_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
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ${{ matrix.os.name }}-${{ matrix.os.version }}
strategy:
fail-fast: false
matrix:
os:
- name: ubuntu
version: 24.04
build_type: [Release, Debug]
cpp_version: [20, 23, 26]
boost_version: [1.86.0]
compiler:
- vendor: GNU
version: 13
executable: g++-13
- vendor: GNU
version: 14
executable: g++-14
- vendor: LLVM
version: 19
executable: clang++-19
cxxflags: -stdlib=libc++
- vendor: LLVM
version: 20
executable: clang++-20
cxxflags: -stdlib=libc++
exclude:
- compiler:
vendor: GNU
version: 13
cpp_version: 26
steps:
- uses: actions/checkout@v4
- name: Setup Clang
if: matrix.compiler.vendor == 'LLVM'
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh ${{ matrix.compiler.version }} all
- name: Setup GCC
if: matrix.compiler.vendor == 'GNU'
run: sudo apt update && sudo apt install -y g++-${{ matrix.compiler.version }}
- name: Install Dependencies
if: matrix.os.name == 'ubuntu'
run: sudo apt update && sudo apt install -y libtbb-dev
- name: Cache Boost
uses: actions/cache@v4
id: cache-boost
with:
path: ${{ github.workspace }}/boost/dist
key: boost-${{ matrix.boost_version }}-${{ matrix.os.name }}-${{ matrix.compiler.executable }}-${{ matrix.cpp_version }}
- name: Clone Boost
if: steps.cache-boost.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: boostorg/boost
ref: boost-${{ matrix.boost_version }}
path: boost
- name: Configure Boost
if: steps.cache-boost.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/boost
run: |
git submodule update --depth 1 --init tools/boostdep
git submodule update --depth 1 --init tools/cmake
git submodule update --depth 1 --init libs/test
python3 tools/boostdep/depinst/depinst.py -X test -g "--depth 1" test
- name: Build Boost
if: steps.cache-boost.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/boost
run: |
cmake -Bbuild -S. \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.executable }} \
-DCMAKE_CXX_FLAGS=${{ matrix.compiler.cxxflags }} \
-DCMAKE_CXX_STANDARD=${{ matrix.cpp_version }} \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_DEBUG_POSTFIX=d \
-DCMAKE_BUILD_TYPE=Debug
cmake --build build -j
cmake --install build --prefix dist
cmake -Bbuild -S. \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.executable }} \
-DCMAKE_CXX_FLAGS=${{ matrix.compiler.cxxflags }} \
-DCMAKE_CXX_STANDARD=${{ matrix.cpp_version }} \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release
cmake --build build -j
cmake --install build --prefix dist
- name: Configure CMake
run: >
cmake -B ${{ github.workspace }}/build
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.executable }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_CXX_STANDARD=${{ matrix.cpp_version }}
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/boost/dist
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ github.workspace }}/build --verbose --config ${{ matrix.build_type }} --target yk_util_test
- name: Test
working-directory: ${{ github.workspace }}/build/test
run: ./yk_util_test --report_level=short