1
0
mirror of https://github.com/rust-unofficial/awesome-rust.git synced 2024-12-12 19:18:26 +02:00
awesome-rust/.github/workflows/rust.yml

44 lines
1.0 KiB
YAML
Raw Normal View History

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