]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_codegen_cranelift/.github/workflows/main.yml
Auto merge of #83267 - ssomers:btree_prune_range_search_overlap, r=Mark-Simulacrum
[rust.git] / compiler / rustc_codegen_cranelift / .github / workflows / main.yml
1 name: CI
2
3 on:
4   - push
5   - pull_request
6
7 jobs:
8   build:
9     runs-on: ${{ matrix.os }}
10     timeout-minutes: 60
11
12     strategy:
13       fail-fast: false
14       matrix:
15         include:
16           - os: ubuntu-latest
17           - os: macos-latest
18           # cross-compile from Linux to Windows using mingw
19           - os: ubuntu-latest
20             env:
21               TARGET_TRIPLE: x86_64-pc-windows-gnu
22
23     steps:
24     - uses: actions/checkout@v2
25
26     - name: Cache cargo installed crates
27       uses: actions/cache@v2
28       with:
29         path: ~/.cargo/bin
30         key: ${{ runner.os }}-cargo-installed-crates
31
32     - name: Cache cargo registry and index
33       uses: actions/cache@v2
34       with:
35         path: |
36             ~/.cargo/registry
37             ~/.cargo/git
38         key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}
39
40     - name: Cache cargo target dir
41       uses: actions/cache@v2
42       with:
43         path: target
44         key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
45
46     - name: Install MinGW toolchain and wine
47       if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
48       run: |
49         sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
50         rustup target add x86_64-pc-windows-gnu
51
52     - name: Prepare dependencies
53       run: |
54         git config --global user.email "user@example.com"
55         git config --global user.name "User"
56         ./prepare.sh
57
58     - name: Test
59       env:
60         TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
61       run: |
62         # Enable backtraces for easier debugging
63         export RUST_BACKTRACE=1
64
65         # Reduce amount of benchmark runs as they are slow
66         export COMPILE_RUNS=2
67         export RUN_RUNS=2
68
69         # Enable extra checks
70         export CG_CLIF_ENABLE_VERIFIER=1
71
72         ./test.sh
73
74     - name: Package prebuilt cg_clif
75       run: tar cvfJ cg_clif.tar.xz build
76
77     - name: Upload prebuilt cg_clif
78       if: matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu'
79       uses: actions/upload-artifact@v2
80       with:
81         name: cg_clif-${{ runner.os }}
82         path: cg_clif.tar.xz