-
-
Notifications
You must be signed in to change notification settings - Fork 483
164 lines (147 loc) · 5.63 KB
/
Copy pathbuild_windows.yml
File metadata and controls
164 lines (147 loc) · 5.63 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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Windows
on:
push:
branches:
- "*"
tags:
- "*"
pull_request:
branches:
- "*"
jobs:
build-shared:
name: "Libs: ${{ matrix.libs }}, FS Lib: ${{ matrix.fslib }}, Arch: ${{ matrix.arch }}, Build OS: ${{ matrix.runs-on }}"
runs-on: ${{ matrix.runs-on }}
env:
USERNAME: projectM-visualizer
VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg
FEED_URL: https://nuget.pkg.github.com/projectM-visualizer/index.json
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/projectM-visualizer/index.json,readwrite"
strategy:
fail-fast: false
matrix:
libs: ['shared', 'static']
fslib: ['stl', 'boost']
arch: ['X64', 'Win32']
runs-on: ['windows-2025', 'windows-2022']
steps:
- name: Checkout vcpkg
uses: actions/checkout@v7
with:
repository: microsoft/vcpkg
path: vcpkg
submodules: recursive
- name: Bootstrap vcpkg
shell: pwsh
run: |
${{ github.workspace }}/vcpkg/bootstrap-vcpkg.bat
${{ env.VCPKG_EXE }} fetch nuget
- name: Add NuGet sources
shell: pwsh
run: |
.$(${{ env.VCPKG_EXE }} fetch nuget) `
sources add `
-Source "${{ env.FEED_URL }}" `
-StorePasswordInClearText `
-Name GitHubPackages `
-UserName "${{ env.USERNAME }}" `
-Password "${{ secrets.VCPKG_PACKAGES_TOKEN }}"
.$(${{ env.VCPKG_EXE }} fetch nuget) `
setapikey "${{ secrets.VCPKG_PACKAGES_TOKEN }}" `
-Source "${{ env.FEED_URL }}"
- name: Checkout libprojectM
uses: actions/checkout@v7
with:
submodules: 'recursive'
- name: Configure Build
run: |
if("${{ matrix.libs }}" -eq "shared") {
$shared_libs = "ON"
} else {
$shared_libs = "OFF"
}
if("${{ matrix.fslib }}" -eq "boost") {
$use_boost = "ON"
} else {
$use_boost = "OFF"
}
if("${{ matrix.arch }}" -eq "X64") {
$triplet = "x64-windows"
} else {
$triplet = "x86-windows"
}
if("${{ matrix.libs }}" -eq "shared") {
$runtime = "DLL"
} else {
$runtime = ""
$triplet = $triplet + "-static"
}
if("${{ matrix.runs-on }}" -eq "windows-2022") {
$generator = "Visual Studio 17 2022"
} else {
$generator = "Visual Studio 18 2026"
}
cmake -G "$($generator)" `
-A "${{ matrix.arch }}" `
-S "${{ github.workspace }}" `
-B "${{ github.workspace }}/cmake-build" `
-DCMAKE_TOOLCHAIN_FILE="${Env:VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET="$($triplet)" `
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install" `
-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>$($runtime)" `
-DCMAKE_VERBOSE_MAKEFILE=YES `
-DBUILD_SHARED_LIBS="$($shared_libs)" `
-DENABLE_BOOST_FILESYSTEM="$($use_boost)" `
-DENABLE_CXX_INTERFACE=YES `
-DBUILD_TESTING=YES `
-DCMAKE_VERBOSE_MAKEFILE=ON
- name: Build Debug
run: cmake --build "${{ github.workspace }}/cmake-build" --config "Debug" --parallel
- name: Run Unit Tests
run: ctest --test-dir "${{ github.workspace }}/cmake-build" --verbose --build-config "Debug"
- name: Build Release
run: cmake --build "${{ github.workspace }}/cmake-build" --config "Release" --parallel
- name: Install
run: |
cmake --build "${{ github.workspace }}/cmake-build" --config "Debug" --target INSTALL
cmake --build "${{ github.workspace }}/cmake-build" --config "Release" --target INSTALL
- name: Test C++ Interface
run: |
if("${{ matrix.fslib }}" -eq "boost") {
$use_boost = "ON"
} else {
$use_boost = "OFF"
}
if("${{ matrix.arch }}" -eq "X64") {
$triplet = "x64-windows"
} else {
$triplet = "x86-windows"
}
if("${{ matrix.libs }}" -eq "shared") {
$runtime = "DLL"
} else {
$runtime = ""
$triplet = $triplet + "-static"
}
if("${{ matrix.runs-on }}" -eq "windows-2022") {
$generator = "Visual Studio 17 2022"
} else {
$generator = "Visual Studio 18 2026"
}
cmake -G "$($generator)" `
-A "${{ matrix.arch }}" `
-S "${{ github.workspace }}/tests/cxx-interface" `
-B "${{ github.workspace }}/cmake-build-cxx-api" `
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/install" `
-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>$($runtime)" `
-DCMAKE_TOOLCHAIN_FILE="${Env:VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET="$($triplet)" `
-DENABLE_BOOST_FILESYSTEM="$($use_boost)" `
-DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build "${{ github.workspace }}/cmake-build-cxx-api" --config "Debug"
cmake --build "${{ github.workspace }}/cmake-build-cxx-api" --config "Release"
- name: Upload Artifact
uses: actions/upload-artifact@v7
with:
name: projectm-windows-${{ matrix.libs }}-${{ matrix.fslib }}-${{ matrix.arch }}-${{ matrix.runs-on }}
path: install/*