Format #170
Workflow file for this run
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: build | |
on: | |
push: | |
jobs: | |
cargo-build: | |
name: cargo build | |
runs-on: ubuntu-latest | |
env: | |
CARGO_NET_GIT_FETCH_WITH_CLI: "true" | |
RUSTFLAGS: "-D warnings" # fail on warnings | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install tools | |
run: | | |
rustup show | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "build" # share the cache across jobs | |
- name: build | |
run: | | |
cargo build --release --all-targets --all-features | |
# Sadly, `cargo build --locked` isn't enough to check that the lockfile | |
# is up to date, as it will happily run even if there are extra entries in | |
# there. | |
# | |
# It does, however, make sure that the file is not updated, which is quite | |
# unhelpful. | |
- name: ensure lockfile hasn't changed | |
run: | | |
if [[ -n "$(git status --porcelain Cargo.lock)" ]]; then | |
echo 'The Cargo.lock file was changed!' | |
git diff Cargo.lock | |
exit 1 | |
fi | |
- name: clippy | |
run: | | |
cargo clippy --release --all-targets --all-features |