9 runs-on: ${{ matrix.os }}
14 os: [ubuntu-latest, macos-latest]
17 - uses: actions/checkout@v2
19 # https://github.com/actions/cache/issues/133
20 - name: Fixup owner of ~/.cargo/
21 # Don't remove the trailing /. It is necessary to follow the symlink.
22 run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
24 - name: Cache cargo installed crates
25 uses: actions/cache@v1.1.2
28 key: cargo-installed-crates2-${{ matrix.os }}
30 - name: Cache cargo registry
31 uses: actions/cache@v1
33 path: ~/.cargo/registry
34 key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }}
36 - name: Cache cargo index
37 uses: actions/cache@v1
40 key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
42 - name: Cache cargo target dir
43 uses: actions/cache@v1.1.2
46 key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}
48 - name: Prepare dependencies
50 git config --global user.email "user@example.com"
51 git config --global user.name "User"
54 # Compile is a separate step, as the actions-rs/cargo action supports error annotations
56 uses: actions-rs/cargo@v1.0.1
63 # Enable backtraces for easier debugging
64 export RUST_BACKTRACE=1
66 # Reduce amount of benchmark runs as they are slow