2021-01-31 07:46:10 -05:00
|
|
|
name: Rust
|
|
|
|
on:
|
|
|
|
push:
|
2021-08-08 14:52:32 -04:00
|
|
|
branches:
|
2022-06-11 05:17:08 -04:00
|
|
|
- main
|
2021-01-31 07:46:10 -05:00
|
|
|
pull_request:
|
2021-08-08 14:52:32 -04:00
|
|
|
branches:
|
2022-06-11 05:17:08 -04:00
|
|
|
- main
|
2021-06-13 10:51:37 -04:00
|
|
|
schedule:
|
2021-08-08 14:52:32 -04:00
|
|
|
- cron: 0 0 * * *
|
2021-01-31 07:46:10 -05:00
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-08-08 14:52:32 -04:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
2021-10-16 16:56:51 -04:00
|
|
|
components: rustfmt
|
2021-08-08 14:52:32 -04:00
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
|
|
- name: Get random cache id
|
|
|
|
run: echo "CACHE_ID=$((RANDOM))" >> $GITHUB_ENV
|
|
|
|
shell: bash
|
2022-06-13 04:38:37 -04:00
|
|
|
- uses: pat-s/always-upload-cache@v3.0.1
|
2021-08-08 14:52:32 -04:00
|
|
|
with:
|
2021-08-10 18:55:13 -04:00
|
|
|
path: results/*.yaml
|
2021-08-08 15:06:14 -04:00
|
|
|
key: results-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('README.md') }}-${{ env.CACHE_ID }}
|
2021-08-08 14:52:32 -04:00
|
|
|
restore-keys: |
|
|
|
|
results-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('README.md') }}-
|
|
|
|
results-${{ hashFiles('Cargo.lock') }}-
|
|
|
|
results-
|
2021-10-16 16:56:51 -04:00
|
|
|
- name: Check Format
|
|
|
|
run: cargo fmt -- --check
|
2021-08-08 14:52:32 -04:00
|
|
|
- name: Build
|
|
|
|
run: cargo build
|
2022-06-11 05:33:22 -04:00
|
|
|
- name: Run
|
|
|
|
run: cargo run
|
|
|
|
env:
|
2022-06-11 05:40:33 -04:00
|
|
|
USERNAME_FOR_GITHUB: ${{ secrets.USERNAME_FOR_GITHUB }}
|
|
|
|
TOKEN_FOR_GITHUB: ${{ secrets.TOKEN_FOR_GITHUB }}
|
2022-06-11 05:33:22 -04:00
|
|
|
RUST_LOG: warn
|