-
Notifications
You must be signed in to change notification settings - Fork 260
169 lines (150 loc) · 6.2 KB
/
Copy pathcmake-windows.yml
File metadata and controls
169 lines (150 loc) · 6.2 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
165
166
167
168
169
name: Windows CMake CI
# Builds xLights with CMake + Ninja using the vendored libs (no vcpkg).
# Ninja advantages over the VS generator:
# - CMAKE_CXX_COMPILER_LAUNCHER=sccache works natively (no cl.bat shim).
# - Faster configure and incremental builds.
# - Single-config — no /p:Configuration= indirection through MSBuild.
#
# curl: linked directly from the vendored lib\windows64\libcurl.dll.a
# (CMakeLists.txt falls back to it when no .lib is present).
on:
push:
branches: [ master ]
paths-ignore:
- '.github/workflows/*.yml'
- '.github/ISSUE_TEMPLATE/*.md'
- 'build_scripts/**'
- 'ci_scripts/**'
- 'cmudict/**'
- 'documentation/**'
- 'download/**'
- 'resources/**'
- 'lib/windows/**'
- 'lib/windows64/**'
- 'songs/**'
- 'TipOfDay/**'
- 'xlDo/**'
- '*.md'
- '*.yml'
- '*.txt'
- '*.docx'
- 'README.*'
pull_request:
branches: [ master ]
paths-ignore:
- '.github/workflows/*.yml'
- '.github/ISSUE_TEMPLATE/*.md'
- 'build_scripts/**'
- 'ci_scripts/**'
- 'cmudict/**'
- 'documentation/**'
- 'download/**'
- 'resources/**'
- 'songs/**'
- 'TipOfDay/**'
- 'xlDo/**'
- '*.md'
- '*.yml'
- '*.txt'
- '*.docx'
- 'README.*'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
cmake-windows:
name: CMake / Ninja / Windows x64
runs-on: windows-latest
env:
SCCACHE_GHA_ENABLED: "true"
BUILD_DIR: cmake_ninja
steps:
# ── Checkout ──────────────────────────────────────────────────────────
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
# ── MSVC environment ──────────────────────────────────────────────────
# Ninja drives cl.exe directly — the MSVC dev environment must be active.
- name: Setup MSVC (x64)
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
# ── ISPC ──────────────────────────────────────────────────────────────
- name: Install ISPC
uses: ispc/install-ispc-action@main
with:
version: 1.31.0
# glslc (ships in the Vulkan SDK's Bin) compiles the .comp compute kernels
# to SPIR-V headers. The CMake Vulkan block is mandatory on Windows and
# aborts with FATAL_ERROR if glslc is missing, so the SDK must be present
# before Configure. The action exports VULKAN_SDK and adds Bin to PATH, so
# the CMakeLists find_program(glslc) HINT resolves.
- name: Install Vulkan SDK
uses: jakoch/install-vulkan-sdk-action@v1
with:
install_runtime: false
cache: true
# ── sccache ───────────────────────────────────────────────────────────
# Ninja supports CMAKE_CXX_COMPILER_LAUNCHER natively — no cl.bat shim.
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.10
- name: Configure sccache
shell: bash
run: |
if ! sccache --zero-stats; then
echo "::warning::sccache GHA backend unavailable; falling back to local disk"
echo "SCCACHE_GHA_ENABLED=" >> "$GITHUB_ENV"
sccache --stop-server 2>/dev/null || true
fi
# ── wxWidgets ─────────────────────────────────────────────────────────
- name: Get wxWidgets HEAD SHA
id: wx-sha
shell: bash
run: |
sha=$(git ls-remote https://github.com/xLightsSequencer/wxWidgets.git HEAD \
| cut -f1 | head -c 12)
echo "sha=$sha" >> "$GITHUB_OUTPUT"
- name: Cache wxWidgets
id: cache-wx
uses: actions/cache@v4
with:
path: ${{ github.workspace }}\wxWidgets
key: wxwidgets-msvc2022-x64-ninja-${{ steps.wx-sha.outputs.sha }}
- name: Checkout wxWidgets
if: steps.cache-wx.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: xLightsSequencer/wxWidgets
path: wxWidgets
submodules: recursive
- name: Build wxWidgets (Release)
if: steps.cache-wx.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}\wxWidgets
run: msbuild /m .\build\msw\wx_vc17.sln /p:Configuration="Release" /p:Platform="x64"
# ── Configure ─────────────────────────────────────────────────────────
- name: Configure CMake
shell: cmd
run: |
cmake -S . -B %BUILD_DIR% ^
-G Ninja ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_C_COMPILER=cl ^
-DCMAKE_CXX_COMPILER=cl ^
-DCMAKE_C_COMPILER_LAUNCHER=sccache ^
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-DwxWidgets_ROOT_DIR=${{ github.workspace }}\wxWidgets
# ── Build ─────────────────────────────────────────────────────────────
- name: Build
shell: cmd
run: cmake --build %BUILD_DIR% --parallel 8
- name: sccache stats
run: sccache --show-stats
# ── Upload artifact ───────────────────────────────────────────────────
- name: Upload xLights exe
uses: actions/upload-artifact@v4
with:
name: xLights_Exe
path: bin\**
retention-days: 7