2929 matrix :
3030 include :
3131 - os : ubuntu-latest
32+ env :
33+ TARGET_TRIPLE : x86_64-unknown-linux-gnu
3234 - os : macos-latest
35+ env :
36+ TARGET_TRIPLE : x86_64-apple-darwin
3337 # cross-compile from Linux to Windows using mingw
3438 - os : ubuntu-latest
3539 env :
@@ -112,7 +116,7 @@ jobs:
112116 if : matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu'
113117 uses : actions/upload-artifact@v2
114118 with :
115- name : cg_clif-${{ runner.os }}
119+ name : cg_clif-${{ matrix.env.TARGET_TRIPLE }}
116120 path : cg_clif.tar.xz
117121
118122 - name : Upload prebuilt cg_clif (cross compile)
@@ -122,56 +126,89 @@ jobs:
122126 name : cg_clif-${{ runner.os }}-cross-x86_64-mingw
123127 path : cg_clif.tar.xz
124128
125- build_windows :
126- runs-on : windows-latest
129+ windows :
130+ runs-on : ${{ matrix.os }}
127131 timeout-minutes : 60
128132
133+ strategy :
134+ fail-fast : false
135+ matrix :
136+ include :
137+ # Native Windows build with MSVC
138+ - os : windows-latest
139+ env :
140+ TARGET_TRIPLE : x86_64-pc-windows-msvc
141+ # cross-compile from Windows to Windows MinGW
142+ - os : windows-latest
143+ env :
144+ TARGET_TRIPLE : x86_64-pc-windows-gnu
145+
129146 steps :
130147 - uses : actions/checkout@v3
131148
132- # - name: Cache cargo installed crates
133- # uses: actions/cache@v2
134- # with:
135- # path: ~/.cargo/bin
136- # key: ${{ runner.os }}-cargo-installed-crates
137-
138- # - name: Cache cargo registry and index
139- # uses: actions/cache@v2
140- # with:
141- # path: |
142- # ~/.cargo/registry
143- # ~/.cargo/git
144- # key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}
145-
146- # - name: Cache cargo target dir
147- # uses: actions/cache@v2
148- # with:
149- # path: target
150- # key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
149+ - name : Cache cargo installed crates
150+ uses : actions/cache@v2
151+ with :
152+ path : ~/.cargo/bin
153+ key : ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-installed-crates
154+
155+ - name : Cache cargo registry and index
156+ uses : actions/cache@v2
157+ with :
158+ path : |
159+ ~/.cargo/registry
160+ ~/.cargo/git
161+ key : ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}
162+
163+ - name : Cache cargo target dir
164+ uses : actions/cache@v2
165+ with :
166+ path : target
167+ key : ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
168+
169+ - name : Set MinGW as the default toolchain
170+ if : matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
171+ run : rustup set default-host x86_64-pc-windows-gnu
151172
152173 - name : Prepare dependencies
153174 run : |
154175 git config --global user.email "[email protected] " 155176 git config --global user.name "User"
156177 git config --global core.autocrlf false
157- rustup set default-host x86_64-pc-windows-gnu
158178 rustc y.rs -o y.exe -g
159179 ./y.exe prepare
160180
181+ - name : Build without unstable features
182+ env :
183+ TARGET_TRIPLE : ${{ matrix.env.TARGET_TRIPLE }}
184+ # This is the config rust-lang/rust uses for builds
185+ run : ./y.rs build --no-unstable-features
186+
161187 - name : Build
162- # name: Test
188+ run : ./y.rs build --sysroot none
189+
190+ - name : Test
163191 run : |
164192 # Enable backtraces for easier debugging
165- # $Env:RUST_BACKTRACE=1
193+ $Env:RUST_BACKTRACE=1
166194
167195 # Reduce amount of benchmark runs as they are slow
168- # $Env:COMPILE_RUNS=2
169- # $Env:RUN_RUNS=2
196+ $Env:COMPILE_RUNS=2
197+ $Env:RUN_RUNS=2
170198
171199 # Enable extra checks
172- #$Env:CG_CLIF_ENABLE_VERIFIER=1
173-
174- ./y.exe build
200+ $Env:CG_CLIF_ENABLE_VERIFIER=1
201+
202+ # WIP Disable some tests
203+
204+ # This fails due to some weird argument handling by hyperfine, not an actual regression
205+ # more of a build system issue
206+ (Get-Content config.txt) -replace '(bench.simple-raytracer)', '# $1' | Out-File config.txt
207+
208+ # This fails with a different output than expected
209+ (Get-Content config.txt) -replace '(test.regex-shootout-regex-dna)', '# $1' | Out-File config.txt
210+
211+ ./y.exe test
175212
176213 - name : Package prebuilt cg_clif
177214 # don't use compression as xzip isn't supported by tar on windows and bzip2 hangs
@@ -180,5 +217,5 @@ jobs:
180217 - name : Upload prebuilt cg_clif
181218 uses : actions/upload-artifact@v2
182219 with :
183- name : cg_clif-${{ runner.os }}
220+ name : cg_clif-${{ matrix.env.TARGET_TRIPLE }}
184221 path : cg_clif.tar
0 commit comments