2020-03-13 12:25:18 -05:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
- push
|
|
|
|
- pull_request
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-03-14 06:47:18 -05:00
|
|
|
|
2020-03-13 13:34:35 -05:00
|
|
|
# https://github.com/actions/cache/issues/133
|
|
|
|
- name: Fixup owner of ~/.cargo/bin
|
2020-03-13 14:24:52 -05:00
|
|
|
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo
|
2020-03-14 06:47:18 -05:00
|
|
|
|
2020-03-13 12:25:18 -05:00
|
|
|
- name: Cache cargo installed crates
|
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
2020-03-13 12:54:20 -05:00
|
|
|
path: ~/.cargo/bin
|
2020-03-14 06:47:18 -05:00
|
|
|
key: cargo-installed-crates2-${{ matrix.os }}
|
2020-03-13 12:25:18 -05:00
|
|
|
|
2020-03-13 13:44:50 -05:00
|
|
|
- name: Cache cargo registry
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/registry
|
2020-03-14 06:49:52 -05:00
|
|
|
key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }}
|
2020-03-13 13:44:50 -05:00
|
|
|
|
|
|
|
- name: Cache cargo index
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/git
|
|
|
|
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
|
|
|
|
- name: Cache cargo target dir
|
2020-03-13 13:24:17 -05:00
|
|
|
uses: actions/cache@v1.1.2
|
|
|
|
with:
|
|
|
|
path: target
|
2020-03-13 13:44:50 -05:00
|
|
|
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}
|
2020-03-13 13:24:17 -05:00
|
|
|
|
2020-03-13 12:25:18 -05:00
|
|
|
- name: Prepare dependencies
|
|
|
|
run: |
|
|
|
|
git config --global user.email "user@example.com"
|
|
|
|
git config --global user.name "User"
|
|
|
|
./prepare.sh
|
2020-03-14 06:47:18 -05:00
|
|
|
|
2020-03-13 12:25:18 -05:00
|
|
|
# Compile is a separate step, as the actions-rs/cargo action supports error annotations
|
|
|
|
- name: Compile
|
|
|
|
uses: actions-rs/cargo@v1.0.1
|
|
|
|
with:
|
|
|
|
command: build
|
|
|
|
args: --release
|
2020-03-14 06:47:18 -05:00
|
|
|
|
2020-03-13 12:25:18 -05:00
|
|
|
- name: Test
|
|
|
|
run: |
|
|
|
|
# Enable backtraces for easier debugging
|
|
|
|
export RUST_BACKTRACE=1
|
2020-03-14 06:47:18 -05:00
|
|
|
|
2020-03-13 12:25:18 -05:00
|
|
|
# Reduce amount of benchmark runs as they are slow
|
|
|
|
export COMPILE_RUNS=2
|
|
|
|
export RUN_RUNS=2
|
2020-03-14 06:47:18 -05:00
|
|
|
|
2020-03-13 12:25:18 -05:00
|
|
|
./test.sh --release
|