Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 481484c

Browse files
committed
Windows MinGW & MSVC Matrix CI
1 parent ba56e8f commit 481484c

File tree

1 file changed

+32
-10
lines changed

1 file changed

+32
-10
lines changed

.github/workflows/main.yml

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,21 @@ jobs:
122122
name: cg_clif-${{ runner.os }}-cross-x86_64-mingw
123123
path: cg_clif.tar.xz
124124

125-
build_windows:
126-
runs-on: windows-latest
125+
windows:
126+
runs-on: ${{ matrix.os }}
127127
timeout-minutes: 60
128128

129+
strategy:
130+
fail-fast: false
131+
matrix:
132+
include:
133+
# Native Windows build with MSVC
134+
- os: windows-latest
135+
# cross-compile from Windows to Windows MinGW
136+
- os: windows-latest
137+
env:
138+
TARGET_TRIPLE: x86_64-pc-windows-gnu
139+
129140
steps:
130141
- uses: actions/checkout@v3
131142

@@ -149,29 +160,40 @@ jobs:
149160
# path: target
150161
# key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
151162

163+
- name: Set MinGW as the default toolchain
164+
if: matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
165+
run: rustup set default-host x86_64-pc-windows-gnu
166+
152167
- name: Prepare dependencies
153168
run: |
154169
git config --global user.email "user@example.com"
155170
git config --global user.name "User"
156171
git config --global core.autocrlf false
157-
rustup set default-host x86_64-pc-windows-gnu
158172
rustc y.rs -o y.exe -g
159173
./y.exe prepare
160174
175+
- name: Build without unstable features
176+
env:
177+
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
178+
# This is the config rust-lang/rust uses for builds
179+
run: ./y.rs build --no-unstable-features
180+
161181
- name: Build
162-
#name: Test
182+
run: ./y.rs build --sysroot none
183+
184+
- name: Test
163185
run: |
164186
# Enable backtraces for easier debugging
165-
#$Env:RUST_BACKTRACE=1
187+
$Env:RUST_BACKTRACE=1
166188
167189
# Reduce amount of benchmark runs as they are slow
168-
#$Env:COMPILE_RUNS=2
169-
#$Env:RUN_RUNS=2
190+
$Env:COMPILE_RUNS=2
191+
$Env:RUN_RUNS=2
170192
171193
# Enable extra checks
172-
#$Env:CG_CLIF_ENABLE_VERIFIER=1
194+
$Env:CG_CLIF_ENABLE_VERIFIER=1
173195
174-
./y.exe build
196+
./y.exe test
175197
176198
- name: Package prebuilt cg_clif
177199
# don't use compression as xzip isn't supported by tar on windows and bzip2 hangs
@@ -180,5 +202,5 @@ jobs:
180202
- name: Upload prebuilt cg_clif
181203
uses: actions/upload-artifact@v2
182204
with:
183-
name: cg_clif-${{ runner.os }}
205+
name: cg_clif-${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}
184206
path: cg_clif.tar

0 commit comments

Comments
 (0)