-
Notifications
You must be signed in to change notification settings - Fork 20
87 lines (71 loc) · 2.48 KB
/
Copy pathbuild_and_test.yml
File metadata and controls
87 lines (71 loc) · 2.48 KB
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
name: Build & Test
on:
push:
branches:
- 'feat/*'
- 'fix/*'
pull_request:
branches: ["master"]
env:
BUILD_TYPE: Release
jobs:
compiler_matrix:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
cxx_standard: [14, 17, 20]
compiler:
- pkg: g++-14
cxx: g++-14
- pkg: g++-13
cxx: g++-13
- pkg: g++-12
cxx: g++-12
- pkg: g++-11
cxx: g++-11
- pkg: clang-18
cxx: clang++-18
- pkg: clang-17
cxx: clang++-17
- pkg: clang-16
cxx: clang++-16
steps:
- name: Add universe repository
run: sudo add-apt-repository universe
- name: Update apt
run: sudo apt-get update
- name: Do install
run: sudo apt-get install -y ${{ matrix.compiler.pkg }} cmake ninja-build libgtest-dev libgmock-dev
- name: Checkout
uses: actions/checkout@v2
- name: CMake Configure
run: cmake -B ${{github.workspace}}/build -G"Ninja" -DINT_TREE_USE_OPTIONAL_POLYFILL=on -DINT_TREE_BUILD_EXAMPLES=on -DINT_TREE_ENABLE_TESTS=on -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }}
- name: Build
run: cmake --build ${{github.workspace}}/build
- name: Test
working-directory: ${{github.workspace}}/build
run: ./tests/tree-tests
msvc:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup MSVC
uses: microsoft/setup-msbuild@v1.0.2
- name: Install vcpkg and gtest
run: |
git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg.exe install gtest
shell: pwsh
env:
VCPKG_DEFAULT_TRIPLET: x64-windows
- name: CMake Configure
run: cmake -B ${{github.workspace}}/build -G"Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_CXX_STANDARD=20 -DINT_TREE_USE_OPTIONAL_POLYFILL=on -DINT_TREE_BUILD_EXAMPLES=on -DINT_TREE_ENABLE_TESTS=on -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: .\tests\tree-tests.exe
shell: cmd