about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAfonso Bordado <afonsobordado@az8.co>2022-08-02 08:31:50 +0100
committerAfonso Bordado <afonsobordado@az8.co>2022-09-26 19:21:30 +0100
commit481484c1410c360acd309ed3ba7fe214a6f61454 (patch)
treec30134690e7a332a9dc8f76dfeb094d6bb3328a7
parentba56e8f313895eefc3e0f7de38c9cde3145b0c04 (diff)
downloadrust-481484c1410c360acd309ed3ba7fe214a6f61454.tar.gz
rust-481484c1410c360acd309ed3ba7fe214a6f61454.zip
Windows MinGW & MSVC Matrix CI
-rw-r--r--.github/workflows/main.yml42
1 files changed, 32 insertions, 10 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index e8897e9ae81..029e83f6aa4 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -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