2021-01-31 12:46:10 +00:00
|
|
|
name: Rust
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-05-05 21:04:07 +00:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
- uses: Swatinem/rust-cache@v1
|
2021-05-05 22:13:41 +00:00
|
|
|
- id: Get random cache id
|
|
|
|
run: echo "CACHE_ID=$((RANDOM))" >> $GITHUB_ENV
|
|
|
|
shell: bash
|
2021-05-05 21:51:43 +00:00
|
|
|
- uses: pat-s/always-upload-cache@v2.1.3
|
2021-05-05 21:04:07 +00:00
|
|
|
with:
|
|
|
|
path: results/results.yaml
|
2021-05-05 22:13:41 +00:00
|
|
|
key: results-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('README.md') }}-${{ env.CACHE_ID }}
|
2021-05-05 21:04:07 +00:00
|
|
|
restore-keys: |
|
2021-05-05 21:58:01 +00:00
|
|
|
results-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('README.md') }}-
|
2021-05-05 21:21:23 +00:00
|
|
|
results-${{ hashFiles('Cargo.lock') }}-
|
2021-05-05 21:04:07 +00:00
|
|
|
results-
|
2021-01-31 12:46:10 +00:00
|
|
|
- name: Build
|
2021-05-05 21:34:47 +00:00
|
|
|
run: cargo build
|
2021-05-05 21:45:44 +00:00
|
|
|
- name: Run
|
|
|
|
run: cargo run
|
2021-05-05 21:29:32 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-05-05 21:34:47 +00:00
|
|
|
RUST_LOG: warn
|