-
Notifications
You must be signed in to change notification settings - Fork 41
131 lines (113 loc) · 4.72 KB
/
all.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
123
124
125
126
127
128
129
130
131
name: C++ build and test
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
build_type: [Release, Debug]
steps:
- uses: actions/checkout@v4
- name: Install Boost (Linux)
if: matrix.os == 'ubuntu-latest'
id: boost
shell: bash
run: sudo apt-get install libboost-all-dev
- name: Install Boost (MacOs)
if: matrix.os == 'macos-latest'
id: boost-macos
shell: bash
run: |
brew install boost
export BOOST_ROOT=$(brew --prefix boost)
echo "boost-root-dir=$BOOST_ROOT" >> "$GITHUB_OUTPUT"
- name: Install vcpkg
if: matrix.os == 'windows-latest'
run: |
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
git checkout master # Use a specific version if needed
./bootstrap-vcpkg.bat
- name: Install Boost (Windows)
if: matrix.os == 'windows-latest'
run: |
cd vcpkg
.\vcpkg.exe install boost-algorithm boost-assert boost-test boost-system boost-chrono boost-container --triplet x64-windows
- name: Set build directory
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake (Linux)
if: matrix.os == 'ubuntu-latest'
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_PREFIX_PATH="${{ steps.boost.outputs.boost-root-dir }}"
-DBOOST_ROOT="${{ steps.boost.outputs.boost-root-dir }}"
-DBoost_DIR="${{ steps.boost.outputs.boost-root-dir }}"
-DBoost_NO_BOOST_CMAKE=ON
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_USE_STATIC_LIBS=OFF
-DBoost_USE_STATIC_RUNTIME=OFF
-DSPOTIFY_JSON_USE_SSE42=OFF
-S ${{ github.workspace }}
- name: Configure CMake (Windows)
if: matrix.os == 'windows-latest'
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake
-DBOOST_ROOT="./vcpkg/installed/x64-windows"
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_LIBRARY_DIRS="${{ github.workspace }}\vcpkg\installed\x64-windows\lib"
-DBoost_INCLUDE_DIR="${{ github.workspace }}\vcpkg\installed\x64-windows\include"
-DBoost_USE_STATIC_LIBS=OFF
-DSPOTIFY_JSON_USE_SSE42=OFF
-S ${{ github.workspace }}
- name: Configure CMake (MacOs)
if: matrix.os == 'macos-latest'
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_PREFIX_PATH="/opt/homebrew/opt/boost"
-DBOOST_ROOT="/opt/homebrew/opt/boost"
-DBoost_NO_BOOST_CMAKE=ON
-DBOOST_LIBRARYDIR="/opt/homebrew/opt/boost/lib"
-DBoost_USE_STATIC_LIBS=OFF
-DBoost_USE_STATIC_RUNTIME=OFF
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
- name: Test (Linux / MacOS)
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ctest --build-config ${{ matrix.build_type }} --rerun-failed --output-on-failure
- name: Test (Windows Relese)
if: matrix.os == 'windows-latest' && matrix.build_type == 'Release'
working-directory: ${{ steps.strings.outputs.build-output-dir }}
shell: pwsh
run: |
$env:PATH += ";${{ github.workspace }}\vcpkg\installed\x64-windows\bin"
ctest --build-config ${{ matrix.build_type }} --rerun-failed --output-on-failure -V
- name: Test (Windows Debug)
if: matrix.os == 'windows-latest' && matrix.build_type == 'Debug'
working-directory: ${{ steps.strings.outputs.build-output-dir }}
shell: pwsh
run: |
$env:PATH += ";${{ github.workspace }}\vcpkg\installed\x64-windows\debug\bin"
ctest --build-config ${{ matrix.build_type }} --rerun-failed --output-on-failure --parallel 4 -V
- name: Install valgrind (Linux)
if: matrix.os == 'ubuntu-latest'
shell: bash
run: sudo apt-get install -qq valgrind
- name: Run valgrind test (Linux)
if: matrix.os == 'ubuntu-latest'
working-directory: ${{ steps.strings.outputs.build-output-dir }}
shell: bash
run: valgrind --leak-check=full ./test/spotify_json_test