Rewrite action as a composite action #66
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: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: swatinem/rust-cache@v2 | |
# This is already installed on GitHub's runners | |
- run: cargo fmt --check | |
- run: rustup toolchain install stable --profile minimal && rustup component add clippy | |
- run: rustup toolchain install nightly --profile minimal | |
- uses: cargo-bins/cargo-binstall@main | |
- run: cargo binstall cargo-udeps --locked --no-confirm --force | |
- run: cargo binstall cargo-deny --locked --no-confirm --force | |
- run: cargo binstall cargo-audit --locked --no-confirm | |
- run: pip install pre-commit && pre-commit install | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pre-commit/ | |
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | |
- run: cargo build # needed for `assert_cmd` tests | |
- run: pre-commit run --all-files |