]> git.lizzy.rs Git - rust.git/blob - .github/workflows/main.yml
Merge pull request #1069 from Veetaha/feat/remove-perms-workaround
[rust.git] / .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
16     steps:
17     - uses: actions/checkout@v2
18
19     - name: Cache cargo installed crates
20       uses: actions/cache@v1.1.2
21       with:
22         path: ~/.cargo/bin
23         key: cargo-installed-crates2-${{ matrix.os }}
24
25     - name: Cache cargo registry
26       uses: actions/cache@v1
27       with:
28         path: ~/.cargo/registry
29         key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }}
30
31     - name: Cache cargo index
32       uses: actions/cache@v1
33       with:
34         path: ~/.cargo/git
35         key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
36
37     - name: Cache cargo target dir
38       uses: actions/cache@v1.1.2
39       with:
40         path: target
41         key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
42
43     - name: Prepare dependencies
44       run: |
45         git config --global user.email "user@example.com"
46         git config --global user.name "User"
47         ./prepare.sh
48
49     # Compile is a separate step, as the actions-rs/cargo action supports error annotations
50     - name: Compile
51       uses: actions-rs/cargo@v1.0.3
52       with:
53         command: rustc
54         args: --release -- -Zrun_dsymutil=no
55
56     - name: Test
57       run: |
58         # Enable backtraces for easier debugging
59         export RUST_BACKTRACE=1
60
61         # Reduce amount of benchmark runs as they are slow
62         export COMPILE_RUNS=2
63         export RUN_RUNS=2
64
65         ./test.sh --release