rust/.github/workflows/main.yml

58 lines
1.3 KiB
YAML
Raw Normal View History

2020-03-13 18:25:18 +01: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
# https://github.com/actions/cache/issues/133
- name: Fixup owner of ~/.cargo/bin
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/bin
2020-03-13 18:25:18 +01:00
- name: Cache cargo installed crates
uses: actions/cache@v1.1.2
with:
path: ~/.cargo/bin
key: cargo-installed-crates-${{ matrix.os }}
2020-03-13 18:25:18 +01:00
- name: Cache target dir
uses: actions/cache@v1.1.2
with:
path: target
key: target-dir-${{ matrix.os }}-${{ hashFiles('rust-toolchain') }}
2020-03-13 18:25:18 +01:00
- name: Prepare dependencies
run: |
git config --global user.email "user@example.com"
git config --global user.name "User"
./prepare.sh
# 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
- name: Test
run: |
# Enable backtraces for easier debugging
export RUST_BACKTRACE=1
# Reduce amount of benchmark runs as they are slow
export COMPILE_RUNS=2
export RUN_RUNS=2
./test.sh --release