-
Notifications
You must be signed in to change notification settings - Fork 1
203 lines (163 loc) · 7.09 KB
/
ci-windows.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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: Build and Release (Windows)
on:
push:
branches:
- main
tags:
- '*'
paths-ignore:
- '**.md'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
paths-ignore:
- '**.md'
- 'changelog.lua'
- '.gitignore'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
if: github.event.pull_request.draft == false
name: Build for Windows
runs-on: windows-latest
env:
SCCACHE_GHA_ENABLED: "true"
defaults:
run:
shell: msys2 {0}
steps:
# MSYS needs to be available before running any git commands
- name: Set up MSYS2 environment
uses: msys2/setup-msys2@v2
with:
install: git make mingw-w64-x86_64-gcc ninja mingw-w64-x86_64-cmake
- name: Disable autocrlf # Messes up everything on Windows since the formatter applies \n
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Check out Git repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: "0" # Required so that git describe actually works (and we can embed the version tag)
- name: Set up sccache
uses: mozilla-actions/[email protected]
- name: Download Webview2 SDK
run: deps/fetch-mswebview2.sh && ls ninjabuild-windows
- name: Configure environment
run: |
export SCCACHE_WINDOWS_PATH=${SCCACHE_PATH}
export SCCACHE_UNIX_PATH=$(cygpath -u "$SCCACHE_WINDOWS_PATH")
echo "SCCACHE_UNIX_PATH=$SCCACHE_UNIX_PATH" >> $GITHUB_ENV
echo "CC=${SCCACHE_UNIX_PATH} gcc" >> $GITHUB_ENV
echo "CXX=${SCCACHE_UNIX_PATH} g++" >> $GITHUB_ENV
- name: Get submodule versions
id: revparse
run: |
echo "openssl=$(git rev-parse HEAD:deps/openssl/openssl)" >> $GITHUB_OUTPUT
echo "wgpu=$(git rev-parse HEAD:deps/gfx-rs/wgpu-native)" >> $GITHUB_OUTPUT
echo "rml=$(git rev-parse HEAD:deps/mikke89/RmlUi)" >> $GITHUB_OUTPUT
echo "labsound=$(git rev-parse HEAD:deps/LabSound/LabSound)" >> $GITHUB_OUTPUT
echo "luajit=$(git rev-parse HEAD:deps/LuaJIT/LuaJIT)" >> $GITHUB_OUTPUT
- name: Cache OpenSSL
id: cache-openssl
uses: actions/cache@v4
with:
path: |
ninjabuild-windows/libcrypto.a
ninjabuild-windows/libssl.a
key: openssl-${{ steps.revparse.outputs.openssl }}-${{ hashFiles('deps/openssl-windowsbuild.sh') }}-${{ runner.os }}
- name: Cache wgpu-native
id: cache-wgpu
uses: actions/cache@v4
with:
path: ninjabuild-windows/libwgpu_native.a
key: wgpu-${{ steps.revparse.outputs.wgpu }}-${{ hashFiles('deps/wgpu-windowsbuild.sh') }}-${{ runner.os }}
- name: Cache RML and FreeType
id: cache-rml
uses: actions/cache@v4
with:
path: |
ninjabuild-windows/libfreetype.a
ninjabuild-windows/librmlui.a
ninjabuild-windows/librmlui_lua.a
key: rml-${{ steps.revparse.outputs.rml }}-freetype-${{ steps.revparse.outputs.freetype }}-${{ steps.revparse.outputs.luajit }}-${{ hashFiles('deps/rml-windowsbuild.sh', 'deps/luajit-windowsbuild.sh') }}-${{ runner.os }}
- name: Cache LabSound
id: cache-labsound
uses: actions/cache@v4
with:
path: |
ninjabuild-windows/libLabSound.a
ninjabuild-windows/libLabSoundRtAudio.a
ninjabuild-windows/libnyquist.a
key: labsound-${{ steps.revparse.outputs.labsound }}-${{ hashFiles('deps/labsound-windowsbuild.sh') }}-${{ runner.os }}
- name: Start Windows Audio engine # Required for LabSound tests
run: net start audiosrv
- name: Set up virtual audio device # Required for LabSound tests
uses: LABSN/sound-ci-helpers@v1
- name: Generate versions.lua # Required for those libraries that don't export versioning information
run: deps/discover-submodule-versions.sh && cat deps/versions.lua
- name: Build luajit
run: deps/luajit-windowsbuild.sh && ls ninjabuild-windows
- name: Build wgpu
if: steps.cache-wgpu.outputs.cache-hit != 'true' || startsWith(github.ref, 'refs/tags/')
run: |
pacman -S mingw-w64-x86_64-rust --noconfirm
deps/wgpu-windowsbuild.sh
ls ninjabuild-windows
- name: Build luv and libuv
run: deps/luv-windowsbuild.sh && ls ninjabuild-windows
- name: Build glfw
run: deps/glfw-windowsbuild.sh && ls ninjabuild-windows
- name: Build miniz
run: deps/miniz-windowsbuild.sh && ls ninjabuild-windows
- name: Build rapidjson
run: deps/rapidjson-windowsbuild.sh && ls ninjabuild-windows
- name: Build openssl
if: steps.cache-openssl.outputs.cache-hit != 'true' || startsWith(github.ref, 'refs/tags/')
run: deps/openssl-windowsbuild.sh && ls ninjabuild-windows
- name: Build lua-openssl
run: deps/luaopenssl-windowsbuild.sh && ls ninjabuild-windows
- name: Build zlib
run: deps/zlib-windowsbuild.sh && ls ninjabuild-windows
- name: Build pcre
run: deps/pcre-windowsbuild.sh && ls ninjabuild-windows
- name: Build uwebsockets
run: deps/uws-windowsbuild.sh && ls ninjabuild-windows
- name: Build RmlUI with FreeType
if: steps.cache-rml.outputs.cache-hit != 'true' || startsWith(github.ref, 'refs/tags/')
run: deps/rml-windowsbuild.sh && ls ninjabuild-windows
- name: Build LabSound
if: steps.cache-labsound.outputs.cache-hit != 'true' || startsWith(github.ref, 'refs/tags/')
run: deps/labsound-windowsbuild.sh && ls ninjabuild-windows
- name: Build runtime
run: ls && ./windowsbuild.cmd && ls ninjabuild-windows && cp ninjabuild-windows/evo.exe . && ls
- name: Scan DLL dependencies
run: .github/scan-dll-deps.sh
- name: Add executable to PATH
run: echo 'export PATH="$PATH:$(pwd)"' >> ~/.bash_profile # MSYS doesn't use $GITHUB_PATH
- name: Run smoke tests
run: evo Tests/smoke-test.lua
- name: Run snapshot tests
run: evo Tests/snapshot-test.lua
- name: Run unit tests
run: evo Tests/unit-test.lua
- name: Run integration tests
run: evo Tests/integration-test.lua
- name: Run benchmarks
run: evo .github/run-all-benchmarks.lua
# GitHub adds a heading of their own, so remove the duplicate
- name: Generate CHANGELOG.MD
run: evo create-changelog.lua && tail -n +3 CHANGELOG.MD > CHANGELOG-GITHUB.MD && mv CHANGELOG-GITHUB.MD CHANGELOG.MD
- name: Publish new release
# Truly "continuous" releases may be overkill here, so better only release tagged versions
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: evo.exe
body_path: CHANGELOG.MD
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}