ci: Bump Zig version to latest #299
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: mlugg/setup-zig@v1 | |
with: | |
version: 0.14.0-dev.2265+8a00bd4ce | |
- uses: ilammy/msvc-dev-cmd@v1 | |
if: ${{ matrix.os == 'windows-latest' }} | |
with: | |
arch: x86 | |
- uses: actions/checkout@v4 | |
if: ${{ matrix.os == 'windows-latest' }} | |
with: | |
repository: 'squeek502/win32-samples-rc-tests' | |
submodules: true | |
path: 'win32-samples-rc-tests' | |
- name: Install qemu | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: sudo apt-get update && sudo apt-get install -y qemu-user-static | |
- run: zig version | |
- run: zig env | |
- name: Build | |
run: zig build -Doptimize=ReleaseFast | |
- name: Test | |
run: zig build test | |
- name: Test 32-bit | |
if: ${{ matrix.os != 'macos-latest' }} | |
run: zig build test -Dtarget=x86-native | |
- name: Test big endian (mips) | |
# TODO: Disabled due to segfault when running the compiled resinator | |
# binary with qemu-mips, unsure of the cause but might be in the | |
# arocc code since /:no-preprocess seems to avoid it. | |
if: ${{ matrix.os == 'ubuntu-latest' && false }} | |
run: zig build test -Dtarget=mips-native -fqemu | |
- name: Test big endian (powerpc64) | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: zig build test -Dtarget=powerpc64-native -fqemu | |
- name: Add zig-out to PATH | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: Add-Content $env:GITHUB_PATH "$env:GITHUB_WORKSPACE\zig-out\bin" | |
- name: Setup Win32 Samples | |
if: ${{ matrix.os == 'windows-latest' }} | |
working-directory: ./win32-samples-rc-tests | |
run: .\setup.ps1 | |
- name: Test Win32 Samples | |
if: ${{ matrix.os == 'windows-latest' }} | |
working-directory: ./win32-samples-rc-tests | |
run: .\test.ps1 -ErrorOnAnyDiscrepancies -ErrorOnAnyLikelyPanics -IncludeWin32WillCompileErrorFiles -ExcludeLLVMRC -ExcludeWindres -ExcludeZigRC | |
- name: Extract MinGW headers from resinator | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
echo $null > tmp.rc | |
resinator /:auto-includes gnu tmp.rc | |
del tmp.rc | |
del tmp.res | |
- name: Test Win32 Samples With MinGW headers | |
if: ${{ matrix.os == 'windows-latest' }} | |
working-directory: ./win32-samples-rc-tests | |
run: | | |
$env:INCLUDE = $env:TEMP + "\resinator\include" | |
.\test.ps1 -MinGWCompat -ErrorOnAnyDiscrepancies -ErrorOnAnyLikelyPanics -IncludeWin32WillCompileErrorFiles -ExcludeLLVMRC -ExcludeWindres -ExcludeZigRC | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: win32-samples-rc-tests-results | |
path: 'win32-samples-rc-tests/results.log' |