verify caching works proper #171
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: Rust | |
# Run either when pushing directly to main/master or in a PR targeting main/master | |
on: | |
push: | |
branches: | |
- master | |
- main | |
paths: | |
- "**.rs" | |
- "rust/Cargo.lock" | |
- "rust/Cargo.toml" | |
- ".github/workflows/cargo.yml" | |
pull_request: | |
branches: | |
- master | |
- main | |
# https://github.com/actions-rs/cargo | |
jobs: | |
cargo: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out source repository | |
uses: actions/checkout@v4 | |
- name: Set up Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: Swatinem/[email protected] | |
with: | |
workspaces: ./rust -> target | |
- name: fmt | |
working-directory: rust | |
# workaround for color output | |
env: | |
TERM: xterm-256color | |
run: cargo fmt --check --verbose | |
- name: clippy | |
working-directory: rust | |
env: | |
TERM: xterm-256color | |
# exit non-zero if there are any warnings | |
# https://doc.rust-lang.org/stable/clippy/usage.html | |
run: cargo clippy -- -Dwarnings |