minetest/.github/workflows/windows.yml

145 lines
4.2 KiB
YAML
Raw Normal View History

2023-12-20 21:35:19 +01:00
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/**'
- 'util/buildbot/**'
2023-12-19 20:19:39 +01:00
- 'misc/*.manifest'
2023-12-20 21:35:19 +01:00
- '.github/workflows/windows.yml'
pull_request:
paths:
- 'lib/**.[ch]'
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
- 'irr/**.[ch]'
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'util/buildbot/**'
2023-12-19 20:19:39 +01:00
- 'misc/*.manifest'
2023-12-20 21:35:19 +01:00
- '.github/workflows/windows.yml'
2022-10-19 23:58:36 +02:00
jobs:
2024-04-15 17:08:42 +02:00
mingw:
name: "MinGW cross-compiler (${{ matrix.bits }}-bit)"
2023-12-13 12:54:44 +01:00
runs-on: ubuntu-22.04
2024-04-15 17:08:42 +02:00
strategy:
fail-fast: false
matrix:
bits: [32, 64]
steps:
2024-02-17 15:34:40 +01:00
- uses: actions/checkout@v4
- name: Install compiler
run: |
2024-04-15 17:08:42 +02:00
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y --no-install-recommends gettext wine wine${{ matrix.bits }}
sudo ./util/buildbot/download_toolchain.sh /usr
- name: Build
run: |
2024-04-15 17:08:42 +02:00
EXISTING_MINETEST_DIR=$PWD \
./util/buildbot/buildwin${{ matrix.bits }}.sh B
2024-04-15 17:08:42 +02:00
# Check that the resulting binary can run (DLLs etc.)
- name: Runtime test
run: |
2024-04-15 17:08:42 +02:00
dest=$(mktemp -d)
unzip -q -d "$dest" B/build/*.zip
cd "$dest"/minetest-*-win*
wine bin/minetest.exe --version
2023-12-13 00:04:58 +01:00
2024-02-17 15:34:40 +01:00
- uses: actions/upload-artifact@v4
2023-12-13 00:04:58 +01:00
with:
2024-04-15 17:08:42 +02:00
name: "mingw${{ matrix.bits }}"
2023-12-13 00:04:58 +01:00
path: B/build/*.zip
if-no-files-found: error
msvc:
name: VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }}
runs-on: windows-2019
env:
2024-06-07 17:00:36 +02:00
VCPKG_VERSION: 01f602195983451bc83e72f4214af2cbc495aa94
# 2024.05.24
vcpkg_packages: zlib zstd curl[winssl] openal-soft libvorbis libogg libjpeg-turbo sqlite3 freetype luajit gmp jsoncpp sdl2
strategy:
fail-fast: false
matrix:
config:
- {
arch: x86,
generator: "-G'Visual Studio 16 2019' -A Win32",
vcpkg_triplet: x86-windows
}
- {
arch: x64,
generator: "-G'Visual Studio 16 2019' -A x64",
vcpkg_triplet: x64-windows
}
type: [portable]
# type: [portable, installer]
# The installer type is working, but disabled, to save runner jobs.
# Enable it, when working on the installer.
steps:
2024-02-17 15:34:40 +01:00
- uses: actions/checkout@v4
- name: Restore from cache and run vcpkg
uses: lukka/run-vcpkg@v7
with:
vcpkgArguments: ${{env.vcpkg_packages}}
vcpkgDirectory: '${{ github.workspace }}\vcpkg'
appendedCacheKey: ${{ matrix.config.vcpkg_triplet }}
vcpkgGitCommitId: ${{ env.VCPKG_VERSION }}
vcpkgTriplet: ${{ matrix.config.vcpkg_triplet }}
- name: Minetest CMake
run: |
cmake ${{matrix.config.generator}} `
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" `
-DCMAKE_BUILD_TYPE=Release `
2020-06-22 17:17:36 +02:00
-DENABLE_POSTGRESQL=OFF `
-DENABLE_LUAJIT=TRUE `
-DREQUIRE_LUAJIT=TRUE `
-DRUN_IN_PLACE=${{ contains(matrix.type, 'portable') }} .
- name: Build Minetest
run: cmake --build . --config Release
2024-01-15 20:03:32 +01:00
- name: Unittests
# need this workaround for stdout to work
run: |
$proc = start .\bin\Release\minetest.exe --run-unittests -NoNewWindow -Wait -PassThru
exit $proc.ExitCode
continue-on-error: true # FIXME!!
2024-01-15 20:03:32 +01:00
- name: CPack
run: |
If ($env:TYPE -eq "installer")
{
cpack -G WIX -B "$env:GITHUB_WORKSPACE\Package"
}
ElseIf($env:TYPE -eq "portable")
{
cpack -G ZIP -B "$env:GITHUB_WORKSPACE\Package"
}
2024-01-15 20:03:32 +01:00
rm -r $env:GITHUB_WORKSPACE\Package\_CPack_Packages
env:
TYPE: ${{matrix.type}}
2024-02-17 15:34:40 +01:00
- uses: actions/upload-artifact@v4
with:
name: msvc-${{ matrix.config.arch }}-${{ matrix.type }}
path: .\Package\
2023-12-20 21:35:19 +01:00
if-no-files-found: error