Merge pull request #3 from simonrupf/dependabot/cargo/ratatui-0.26.1 #12
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 test & lint | |
permissions: | |
contents: read | |
checks: write | |
on: | |
push: | |
branches: '*' | |
pull_request: | |
env: | |
RUST_VERSION: 1.72.0 | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
run: | | |
rustup toolchain install ${RUST_VERSION} --profile minimal --no-self-update --component rustfmt clippy | |
rustup default ${RUST_VERSION} | |
- name: Cache cargo registry | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo build | |
uses: actions/cache@v4 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
- name: Execute all unit and integration tests and build examples | |
run: cargo test | |
- name: Check formatting of code and suggest improvements | |
run: cargo fmt -- --check | |
- name: Check for common mistakes and code improvements | |
run: cargo clippy --all-targets --all-features -- -D warnings |