ci: add testing on wine (#393)

* feat(ci): wine testing

* capture all exe

---------

Co-authored-by: Friedel Ziegelmayer <me@dignifiedquire.com>
This commit is contained in:
Asmir Avdicevic
2026-02-06 18:04:56 +08:00
committed by GitHub
parent 1a91e0b538
commit c332d420ce
2 changed files with 64 additions and 0 deletions
+3
View File
@@ -4,3 +4,6 @@ rustflags = ['--cfg', 'getrandom_backend="wasm_js"']
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
[target.x86_64-pc-windows-gnu]
linker = "x86_64-w64-mingw32-gcc"
+61
View File
@@ -0,0 +1,61 @@
name: Wine Tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: wine-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTFLAGS: -Dwarnings
jobs:
wine_test:
name: Wine Sanity Check
runs-on: [self-hosted, linux, X64]
steps:
- uses: actions/checkout@v4
- name: Install Wine
run: |
# Use WineHQ for newer Wine with bcryptprimitives.dll support
sudo dpkg --add-architecture i386
sudo mkdir -pm755 /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -cs)/winehq-$(lsb_release -cs).sources
sudo apt-get update
sudo apt-get install -y --install-recommends winehq-stable || sudo apt-get install -y wine64 wine32
# Initialize Wine prefix
WINEARCH=win64 wineboot --init
- name: Install Rust + mingw target
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-gnu
- name: Install mingw-w64
run: sudo apt-get install -y mingw-w64
- name: Build tests
# Release mode required - debug builds exceed mingw's export ordinal limit (~65k symbols)
run: cargo build --target x86_64-pc-windows-gnu --tests --release
- name: List available tests
run: |
for exe in target/x86_64-pc-windows-gnu/release/deps/*.exe; do
echo "=== Tests in $exe ==="
wine "$exe" --list
done
- name: Run tests under Wine
run: |
for exe in target/x86_64-pc-windows-gnu/release/deps/*.exe; do
echo "=== Running $exe ==="
wine "$exe" --test-threads=1
done