-
Notifications
You must be signed in to change notification settings - Fork 2.8k
48 lines (48 loc) · 1.55 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Load results cache
uses: actions/cache/restore@v4
with:
path: results/*.yaml
key: results-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('README.md') }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
results-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('README.md') }}-${{ github.run_id }}-
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:
USERNAME_FOR_GITHUB: ${{ secrets.USERNAME_FOR_GITHUB }}
TOKEN_FOR_GITHUB: ${{ secrets.TOKEN_FOR_GITHUB }}
RUST_LOG: warn
- name: Save results cache
uses: actions/cache/save@v4
if: always() && (github.ref == 'refs/heads/main' || github.ref == 'refs/pull/1716/merge')
with:
path: results/*.yaml
key: results-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('README.md') }}-${{ github.run_id }}-${{ github.run_attempt }}