1
0
Fork 0
mirror of https://github.com/rust-unofficial/awesome-rust.git synced 2024-12-04 11:55:05 -05:00
rust/.github/workflows/rust.yml
2022-06-11 10:29:34 +01:00

44 lines
1.2 KiB
YAML

name: Rust
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: 0 0 * * *
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v1
- name: Get random cache id
run: echo "CACHE_ID=$((RANDOM))" >> $GITHUB_ENV
shell: bash
- uses: pat-s/always-upload-cache@v2.1.5
with:
path: results/*.yaml
key: results-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('README.md') }}-${{ env.CACHE_ID }}
restore-keys: |
results-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('README.md') }}-
results-${{ hashFiles('Cargo.lock') }}-
results-
- name: Check Format
run: cargo fmt -- --check
- name: Build
run: cargo build
# - name: Run
# run: cargo run
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# RUST_LOG: warn