|
21 | 21 | cargo fmt --check
|
22 | 22 | rustfmt --check build_system/mod.rs
|
23 | 23 |
|
| 24 | +
|
24 | 25 | build:
|
25 | 26 | runs-on: ${{ matrix.os }}
|
26 | 27 | timeout-minutes: 60
|
@@ -112,23 +113,6 @@ jobs:
|
112 | 113 | TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
|
113 | 114 | run: ./y.rs test
|
114 | 115 |
|
115 |
| - - name: Package prebuilt cg_clif |
116 |
| - run: tar cvfJ cg_clif.tar.xz dist |
117 |
| - |
118 |
| - - name: Upload prebuilt cg_clif |
119 |
| - if: matrix.os == 'windows-latest' || matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu' |
120 |
| - uses: actions/upload-artifact@v3 |
121 |
| - with: |
122 |
| - name: cg_clif-${{ matrix.env.TARGET_TRIPLE }} |
123 |
| - path: cg_clif.tar.xz |
124 |
| - |
125 |
| - - name: Upload prebuilt cg_clif (cross compile) |
126 |
| - if: matrix.os != 'windows-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu' |
127 |
| - uses: actions/upload-artifact@v3 |
128 |
| - with: |
129 |
| - name: cg_clif-${{ runner.os }}-cross-x86_64-mingw |
130 |
| - path: cg_clif.tar.xz |
131 |
| - |
132 | 116 |
|
133 | 117 | abi_cafe:
|
134 | 118 | runs-on: ${{ matrix.os }}
|
@@ -186,6 +170,7 @@ jobs:
|
186 | 170 | TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
|
187 | 171 | run: ./y.rs abi-cafe
|
188 | 172 |
|
| 173 | + |
189 | 174 | bench:
|
190 | 175 | runs-on: ubuntu-latest
|
191 | 176 | timeout-minutes: 60
|
@@ -223,7 +208,89 @@ jobs:
|
223 | 208 | run: ./y.rs prepare
|
224 | 209 |
|
225 | 210 | - name: Build
|
226 |
| - run: ./y.rs build --sysroot none |
| 211 | + run: CI_OPT=1 ./y.rs build --sysroot none |
227 | 212 |
|
228 | 213 | - name: Benchmark
|
229 |
| - run: ./y.rs bench |
| 214 | + run: CI_OPT=1 ./y.rs bench |
| 215 | + |
| 216 | + |
| 217 | + dist: |
| 218 | + runs-on: ${{ matrix.os }} |
| 219 | + timeout-minutes: 60 |
| 220 | + |
| 221 | + defaults: |
| 222 | + run: |
| 223 | + shell: bash |
| 224 | + |
| 225 | + strategy: |
| 226 | + fail-fast: false |
| 227 | + matrix: |
| 228 | + include: |
| 229 | + - os: ubuntu-20.04 # FIXME switch to ubuntu-22.04 once #1303 is fixed |
| 230 | + env: |
| 231 | + TARGET_TRIPLE: x86_64-unknown-linux-gnu |
| 232 | + - os: macos-latest |
| 233 | + env: |
| 234 | + TARGET_TRIPLE: x86_64-apple-darwin |
| 235 | + # cross-compile from Linux to Windows using mingw |
| 236 | + - os: ubuntu-latest |
| 237 | + env: |
| 238 | + TARGET_TRIPLE: x86_64-pc-windows-gnu |
| 239 | + - os: windows-latest |
| 240 | + env: |
| 241 | + TARGET_TRIPLE: x86_64-pc-windows-msvc |
| 242 | + - os: windows-latest |
| 243 | + env: |
| 244 | + TARGET_TRIPLE: x86_64-pc-windows-gnu |
| 245 | + |
| 246 | + steps: |
| 247 | + - uses: actions/checkout@v3 |
| 248 | + |
| 249 | + - name: Cache cargo target dir |
| 250 | + uses: actions/cache@v3 |
| 251 | + with: |
| 252 | + path: build/cg_clif |
| 253 | + key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-dist-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }} |
| 254 | + |
| 255 | + - name: Set MinGW as the default toolchain |
| 256 | + if: matrix.os == 'windows-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu' |
| 257 | + run: rustup set default-host x86_64-pc-windows-gnu |
| 258 | + |
| 259 | + - name: Install MinGW toolchain and wine |
| 260 | + if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu' |
| 261 | + run: | |
| 262 | + sudo apt-get update |
| 263 | + sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable |
| 264 | +
|
| 265 | + - name: Use sparse cargo registry |
| 266 | + run: | |
| 267 | + cat >> ~/.cargo/config.toml <<EOF |
| 268 | + [unstable] |
| 269 | + sparse-registry = true |
| 270 | + EOF |
| 271 | +
|
| 272 | + - name: Prepare dependencies |
| 273 | + run: ./y.rs prepare |
| 274 | + |
| 275 | + - name: Build backend |
| 276 | + run: CI_OPT=1 ./y.rs build --sysroot none |
| 277 | + |
| 278 | + - name: Build sysroot |
| 279 | + run: CI_OPT=1 ./y.rs build |
| 280 | + |
| 281 | + - name: Package prebuilt cg_clif |
| 282 | + run: tar cvfJ cg_clif.tar.xz dist |
| 283 | + |
| 284 | + - name: Upload prebuilt cg_clif |
| 285 | + if: matrix.os == 'windows-latest' || matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu' |
| 286 | + uses: actions/upload-artifact@v3 |
| 287 | + with: |
| 288 | + name: cg_clif-${{ matrix.env.TARGET_TRIPLE }} |
| 289 | + path: cg_clif.tar.xz |
| 290 | + |
| 291 | + - name: Upload prebuilt cg_clif (cross compile) |
| 292 | + if: matrix.os != 'windows-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu' |
| 293 | + uses: actions/upload-artifact@v3 |
| 294 | + with: |
| 295 | + name: cg_clif-${{ runner.os }}-cross-x86_64-mingw |
| 296 | + path: cg_clif.tar.xz |
0 commit comments