update readme #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test on PR | |
on: | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
Test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 # Git toolchain to check out code | |
- uses: actions-rs/toolchain@v1 # Rust toolchain | |
with: | |
toolchain: 1.73.0 | |
components: rustfmt, clippy | |
- name: Get OS infomration | |
id: os | |
run: echo "KERNEL=$(uname -r)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-${{steps.os.outputs.KERNEL}}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('**/Cargo.toml') }} | |
- name: Run Rust tests | |
run: cargo test |