-
Notifications
You must be signed in to change notification settings - Fork 2.3k
153 lines (138 loc) · 4.35 KB
/
windows.yml
File metadata and controls
153 lines (138 loc) · 4.35 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
name: windows
# build on c/cpp changes or workflow changes
on:
push:
paths:
- 'lib/**.[ch]'
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- 'util/buildbot/**'
- 'misc/*'
- '.github/workflows/windows.yml'
pull_request:
paths:
- 'lib/**.[ch]'
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- 'util/buildbot/**'
- 'misc/*'
- '.github/workflows/windows.yml'
jobs:
mingw:
name: "MinGW cross-compiler (${{ matrix.config.bits }}-bit)"
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
config:
- { bits: 32, nsis: false }
- { bits: 64, nsis: true }
steps:
- uses: actions/checkout@v6
- name: Install compiler
run: |
source ./util/ci/common.sh
install_mingw_deps '${{matrix.config.bits}}' '${{matrix.config.nsis}}'
if '${{matrix.config.nsis}}'; then
echo 'CMAKE_CXX_COMPILER_LAUNCHER=ccache' >>$GITHUB_ENV
fi
sudo ./util/buildbot/download_toolchain.sh /usr
- name: Build
run: |
EXISTING_MINETEST_DIR=$PWD \
./util/buildbot/buildwin${{ matrix.config.bits }}.sh B
mkdir -p artifact
cp -v B/build/*.zip artifact/
# Check that the resulting binary can run (DLLs etc.)
- name: Runtime test
run: |
dest=$(mktemp -d)
unzip -q -d "$dest" artifact/*.zip
cd "$dest"/luanti-*-win*
wine bin/luanti.exe --version
- name: Build for NSIS
run: |
EXISTING_MINETEST_DIR=$PWD \
./util/buildbot/buildwin${{ matrix.config.bits }}.sh B -DRUN_IN_PLACE=0
dest=$(mktemp -d)
unzip -q -d "$dest" B/build/*.zip
cd "$dest"/luanti-*-nsis
makensis -WX -V3 sfx-launcher.nsi
cp -v "$dest"/*.exe $GITHUB_WORKSPACE/artifact/
if: ${{ matrix.config.nsis }}
- uses: actions/upload-artifact@v5
with:
name: "mingw${{ matrix.config.bits }}"
path: artifact/*.zip
if-no-files-found: error
- uses: actions/upload-artifact@v5
with:
name: "mingw${{ matrix.config.bits }}-nsis"
path: artifact/*.exe
if-no-files-found: error
if: ${{ matrix.config.nsis }}
msvc:
name: VS 2022 ${{ matrix.config.arch }}
runs-on: windows-2025
env:
VCPKG_DEFAULT_TRIPLET: ${{matrix.config.vcpkg_triplet}}
strategy:
fail-fast: false
matrix:
config:
- {
arch: x86,
generator: "-G'Visual Studio 17 2022' -A Win32",
vcpkg_triplet: x86-windows
}
- {
arch: x64,
generator: "-G'Visual Studio 17 2022' -A x64",
vcpkg_triplet: x64-windows
}
steps:
- uses: actions/checkout@v6
- name: Restore from cache and run vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgDirectory: '${{ github.workspace }}\vcpkg'
- name: CMake
# Note: See #15976 for why CMAKE_POLICY_VERSION_MINIMUM=3.5 is set.
run: |
cmake ${{matrix.config.generator}} `
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 `
-DENABLE_POSTGRESQL=OFF `
-DENABLE_LUAJIT=TRUE `
-DREQUIRE_LUAJIT=TRUE `
-DRUN_IN_PLACE=1 .
- name: Build
run: cmake --build . --config Release
- name: Unittests
# need this workaround for stdout to work
run: |
$proc = start .\bin\Release\luanti.exe --run-unittests -NoNewWindow -Wait -PassThru
exit $proc.ExitCode
continue-on-error: true # FIXME!!
- name: CPack
run: |
cpack -G ZIP -B "$env:GITHUB_WORKSPACE\Package"
rm -r $env:GITHUB_WORKSPACE\Package\_CPack_Packages
- uses: actions/upload-artifact@v5
with:
name: msvc-${{ matrix.config.arch }}
path: .\Package\
if-no-files-found: error