]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_codegen_cranelift/.github/workflows/main.yml
Merge commit '70c0f90453701e7d6d9b99aaa1fc6a765937b736' into clippyup
[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
11     strategy:
12       fail-fast: false
13       matrix:
14         os: [ubuntu-latest, macos-latest]
15         env:
16           - BACKEND: ""
17           - BACKEND: --oldbe
18
19     steps:
20     - uses: actions/checkout@v2
21
22     - name: Cache cargo installed crates
23       uses: actions/cache@v2
24       with:
25         path: ~/.cargo/bin
26         key: ${{ runner.os }}-cargo-installed-crates
27
28     - name: Cache cargo registry and index
29       uses: actions/cache@v2
30       with:
31         path: |
32             ~/.cargo/registry
33             ~/.cargo/git
34         key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}
35
36     - name: Cache cargo target dir
37       uses: actions/cache@v2
38       with:
39         path: target
40         key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
41
42     - name: Prepare dependencies
43       run: |
44         git config --global user.email "user@example.com"
45         git config --global user.name "User"
46         ./prepare.sh
47
48     - name: Test
49       run: |
50         # Enable backtraces for easier debugging
51         export RUST_BACKTRACE=1
52
53         # Reduce amount of benchmark runs as they are slow
54         export COMPILE_RUNS=2
55         export RUN_RUNS=2
56
57         ./test.sh $BACKEND
58
59     - name: Package prebuilt cg_clif
60       run: tar cvfJ cg_clif.tar.xz build
61
62     - name: Upload prebuilt cg_clif
63       uses: actions/upload-artifact@v2
64       with:
65         name: cg_clif-${{ runner.os }}
66         path: cg_clif.tar.xz