-
Notifications
You must be signed in to change notification settings - Fork 13
115 lines (99 loc) · 3.67 KB
/
build_and_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
name: Build & test
on:
push:
branches:
- master
tags:
- v**.**
pull_request:
branches:
- master
jobs:
build-test:
strategy:
fail-fast: false
matrix:
build_profile: [clang20d, clang20r, gcc20d, gcc20r, msvc20d, msvc20r, clang17d, clang17r, gcc17d, gcc17r, msvc17d, msvc17r]
include:
- build_profile: clang20d
conan_preset: clang-20-debug
os: ubuntu-latest
- build_profile: clang20r
conan_preset: clang-20-release
os: ubuntu-latest
- build_profile: gcc20d
conan_preset: gcc-20-debug
os: ubuntu-latest
- build_profile: gcc20r
conan_preset: gcc-20-release
os: ubuntu-latest
- build_profile: msvc20d
conan_preset: msvc-20-debug
os: windows-latest
- build_profile: msvc20r
conan_preset: msvc-20-release
os: windows-latest
- build_profile: clang17d
conan_preset: clang-17-debug
os: ubuntu-latest
- build_profile: clang17r
conan_preset: clang-17-release
os: ubuntu-latest
- build_profile: gcc17d
conan_preset: gcc-17-debug
os: ubuntu-latest
- build_profile: gcc17r
conan_preset: gcc-17-release
os: ubuntu-latest
- build_profile: msvc17d
conan_preset: msvc-17-debug
os: windows-latest
- build_profile: msvc17r
conan_preset: msvc-17-release
os: windows-latest
name: ${{ matrix.build_profile }}
runs-on: ${{matrix.os}}
env:
CMAKE_EXTRA: "-DMATHTER_BUILD_TESTS:BOOL=ON -DMATHTER_BUILD_BENCHMARKS:BOOL=ON -DMATHTER_BUILD_EXAMPLES:BOOL=ON"
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@v4
- uses: seanmiddleditch/gha-setup-vsdevenv@master
- run: pip install conan
- name: Install native compilers
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-13 g++-13
sudo update-alternatives --remove-all gcc || true
sudo update-alternatives --remove-all g++ || true
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 10 --slave /usr/bin/g++ g++ /usr/bin/g++-13
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17 clang
sudo update-alternatives --remove-all clang || true
sudo update-alternatives --remove-all clang++ || true
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 10 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-17
- name: Cache conan packages
id: cache-conan
uses: actions/cache@v3
with:
path: ~/.conan2/p
key: conan-cache-packages-${{ matrix.build_profile }}
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
env:
PR: "${{github.workspace}}/.github/build_profiles/${{matrix.build_profile}}"
run: |
cmake -E make_directory "${{github.workspace}}/build"
conan install "${{github.workspace}}" --build=missing -pr $PR -pr:b $PR
conan cache clean
cmake ${{env.CMAKE_EXTRA}} -S "${{github.workspace}}" --preset conan-${{ matrix.conan_preset }}
- name: Build
run: |
cmake --build --preset conan-${{ matrix.conan_preset }}
- name: Test
run: ${{github.workspace}}/build/${{ matrix.conan_preset }}/bin/UnitTest