Windows MinGW & MSVC Matrix CI

This commit is contained in:
Afonso Bordado 2022-08-02 08:31:50 +01:00
parent ba56e8f313
commit 481484c141

View File

@ -122,10 +122,21 @@ jobs:
name: cg_clif-${{ runner.os }}-cross-x86_64-mingw
path: cg_clif.tar.xz
build_windows:
runs-on: windows-latest
windows:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
# Native Windows build with MSVC
- os: windows-latest
# cross-compile from Windows to Windows MinGW
- os: windows-latest
env:
TARGET_TRIPLE: x86_64-pc-windows-gnu
steps:
- uses: actions/checkout@v3
@ -149,29 +160,40 @@ jobs:
# path: target
# key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
- name: Set MinGW as the default toolchain
if: matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
run: rustup set default-host x86_64-pc-windows-gnu
- name: Prepare dependencies
run: |
git config --global user.email "user@example.com"
git config --global user.name "User"
git config --global core.autocrlf false
rustup set default-host x86_64-pc-windows-gnu
rustc y.rs -o y.exe -g
./y.exe prepare
- name: Build without unstable features
env:
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
# This is the config rust-lang/rust uses for builds
run: ./y.rs build --no-unstable-features
- name: Build
#name: Test
run: ./y.rs build --sysroot none
- name: Test
run: |
# Enable backtraces for easier debugging
#$Env:RUST_BACKTRACE=1
$Env:RUST_BACKTRACE=1
# Reduce amount of benchmark runs as they are slow
#$Env:COMPILE_RUNS=2
#$Env:RUN_RUNS=2
$Env:COMPILE_RUNS=2
$Env:RUN_RUNS=2
# Enable extra checks
#$Env:CG_CLIF_ENABLE_VERIFIER=1
$Env:CG_CLIF_ENABLE_VERIFIER=1
./y.exe build
./y.exe test
- name: Package prebuilt cg_clif
# don't use compression as xzip isn't supported by tar on windows and bzip2 hangs
@ -180,5 +202,5 @@ jobs:
- name: Upload prebuilt cg_clif
uses: actions/upload-artifact@v2
with:
name: cg_clif-${{ runner.os }}
name: cg_clif-${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}
path: cg_clif.tar