2525 runs-on : ${{ matrix.os }}
2626 timeout-minutes : 60
2727
28+ defaults :
29+ run :
30+ shell : bash
31+
2832 strategy :
2933 fail-fast : false
3034 matrix :
@@ -46,36 +50,31 @@ jobs:
4650 - os : ubuntu-latest
4751 env :
4852 TARGET_TRIPLE : s390x-unknown-linux-gnu
53+ - os : windows-latest
54+ env :
55+ TARGET_TRIPLE : x86_64-pc-windows-msvc
56+ - os : windows-latest
57+ env :
58+ TARGET_TRIPLE : x86_64-pc-windows-gnu
4959
5060 steps :
5161 - uses : actions/checkout@v3
5262
53- - name : Cache cargo installed crates
54- uses : actions/cache@v3
55- with :
56- path : ~/.cargo/bin
57- key : ${{ runner.os }}-cargo-installed-crates
58-
59- - name : Cache cargo registry and index
60- uses : actions/cache@v3
61- with :
62- path : |
63- ~/.cargo/registry
64- ~/.cargo/git
65- key : ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}
66-
6763 - name : Cache cargo target dir
6864 uses : actions/cache@v3
6965 with :
7066 path : build/cg_clif
71- key : ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
67+ key : ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
68+
69+ - name : Set MinGW as the default toolchain
70+ if : matrix.os == 'windows-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
71+ run : rustup set default-host x86_64-pc-windows-gnu
7272
7373 - name : Install MinGW toolchain and wine
7474 if : matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
7575 run : |
7676 sudo apt-get update
7777 sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
78- rustup target add x86_64-pc-windows-gnu
7978
8079 - name : Install AArch64 toolchain and qemu
8180 if : matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'aarch64-unknown-linux-gnu'
8988 sudo apt-get update
9089 sudo apt-get install -y gcc-s390x-linux-gnu qemu-user
9190
91+ - name : Use sparse cargo registry
92+ run : |
93+ cat >> ~/.cargo/config.toml <<EOF
94+ [unstable]
95+ sparse-registry = true
96+ EOF
97+
9298 - name : Prepare dependencies
9399 run : ./y.rs prepare
94100
@@ -104,70 +110,54 @@ jobs:
104110 - name : Test
105111 env :
106112 TARGET_TRIPLE : ${{ matrix.env.TARGET_TRIPLE }}
107- run : |
108- # Enable backtraces for easier debugging
109- export RUST_BACKTRACE=1
110-
111- # Reduce amount of benchmark runs as they are slow
112- export COMPILE_RUNS=2
113- export RUN_RUNS=2
114-
115- # Enable extra checks
116- export CG_CLIF_ENABLE_VERIFIER=1
117-
118- ./y.rs test
113+ run : ./y.rs test
119114
120115 - name : Package prebuilt cg_clif
121116 run : tar cvfJ cg_clif.tar.xz dist
122117
123118 - name : Upload prebuilt cg_clif
124- if : matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu'
125- uses : actions/upload-artifact@v2
119+ if : matrix.os == 'windows-latest' || matrix. env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu'
120+ uses : actions/upload-artifact@v3
126121 with :
127122 name : cg_clif-${{ matrix.env.TARGET_TRIPLE }}
128123 path : cg_clif.tar.xz
129124
130125 - name : Upload prebuilt cg_clif (cross compile)
131- if : matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
126+ if : matrix.os != 'windows-latest' && matrix. env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
132127 uses : actions/upload-artifact@v3
133128 with :
134129 name : cg_clif-${{ runner.os }}-cross-x86_64-mingw
135130 path : cg_clif.tar.xz
136131
137- windows :
132+
133+ abi_cafe :
138134 runs-on : ${{ matrix.os }}
139135 timeout-minutes : 60
140136
137+ defaults :
138+ run :
139+ shell : bash
140+
141141 strategy :
142- fail-fast : false
142+ fail-fast : true
143143 matrix :
144144 include :
145- # Native Windows build with MSVC
145+ - os : ubuntu-latest
146+ env :
147+ TARGET_TRIPLE : x86_64-unknown-linux-gnu
148+ - os : macos-latest
149+ env :
150+ TARGET_TRIPLE : x86_64-apple-darwin
146151 - os : windows-latest
147152 env :
148153 TARGET_TRIPLE : x86_64-pc-windows-msvc
149- # cross-compile from Windows to Windows MinGW
150154 - os : windows-latest
151155 env :
152156 TARGET_TRIPLE : x86_64-pc-windows-gnu
153157
154158 steps :
155159 - uses : actions/checkout@v3
156160
157- - name : Cache cargo installed crates
158- uses : actions/cache@v3
159- with :
160- path : ~/.cargo/bin
161- key : ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-installed-crates
162-
163- - name : Cache cargo registry and index
164- uses : actions/cache@v3
165- with :
166- path : |
167- ~/.cargo/registry
168- ~/.cargo/git
169- key : ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}
170-
171161 - name : Cache cargo target dir
172162 uses : actions/cache@v3
173163 with :
@@ -178,50 +168,20 @@ jobs:
178168 if : matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
179169 run : rustup set default-host x86_64-pc-windows-gnu
180170
181- - name : Prepare dependencies
171+ - name : Use sparse cargo registry
182172 run : |
183- git config --global core.autocrlf false
184- rustc y.rs -o y.exe -g
185- ./y.exe prepare
173+ cat >> ~/.cargo/config.toml <<EOF
174+ [unstable]
175+ sparse-registry = true
176+ EOF
186177
187- - name : Build without unstable features
188- env :
189- TARGET_TRIPLE : ${{ matrix.env.TARGET_TRIPLE }}
190- # This is the config rust-lang/rust uses for builds
191- run : ./y.rs build --no-unstable-features
178+ - name : Prepare dependencies
179+ run : ./y.rs prepare
192180
193181 - name : Build
194182 run : ./y.rs build --sysroot none
195183
196- - name : Test
197- run : |
198- # Enable backtraces for easier debugging
199- $Env:RUST_BACKTRACE=1
200-
201- # Reduce amount of benchmark runs as they are slow
202- $Env:COMPILE_RUNS=2
203- $Env:RUN_RUNS=2
204-
205- # Enable extra checks
206- $Env:CG_CLIF_ENABLE_VERIFIER=1
207-
208- # WIP Disable some tests
209-
210- # This fails due to some weird argument handling by hyperfine, not an actual regression
211- # more of a build system issue
212- (Get-Content config.txt) -replace '(bench.simple-raytracer)', '# $1' | Out-File config.txt
213-
214- # This fails with a different output than expected
215- (Get-Content config.txt) -replace '(test.regex-shootout-regex-dna)', '# $1' | Out-File config.txt
216-
217- ./y.exe test
218-
219- - name : Package prebuilt cg_clif
220- # don't use compression as xzip isn't supported by tar on windows and bzip2 hangs
221- run : tar cvf cg_clif.tar dist
222-
223- - name : Upload prebuilt cg_clif
224- uses : actions/upload-artifact@v3
225- with :
226- name : cg_clif-${{ matrix.env.TARGET_TRIPLE }}
227- path : cg_clif.tar
184+ - name : Test abi-cafe
185+ env :
186+ TARGET_TRIPLE : ${{ matrix.env.TARGET_TRIPLE }}
187+ run : ./y.rs abi-cafe
0 commit comments