chore(ci): replace running `pre-commit` with just a formatting check

Contrary to what I naively thought, `pre-commit` in CI does not result
in commit messages being checked. Another action `pre-commit` was
doing was running `cargo check`, but this is essentially the same as
building without compilation, and we are testing by building in other
CI-workflows. So we are left with only a formatting check, which does
not need installing and running `pre-commit`.
This commit is contained in:
Mikolaj Wielgus 2024-12-29 02:46:12 +01:00
parent 1567a9a83e
commit 59478e0dbe
2 changed files with 11 additions and 14 deletions

View File

@ -0,0 +1,11 @@
steps:
check_formatting:
image: rust
environment:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
commands:
- rustup component add rustfmt
- cargo fmt --all -- --check
when:
event: [pull_request, push, tag]

View File

@ -1,14 +0,0 @@
steps:
pre-commit:
image: rust
environment:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
commands:
- apt-get -y update > /dev/null
- apt-get -y install pre-commit > /dev/null
- rustup default stable
- rustup component add rustfmt clippy
- pre-commit run --all-files
when:
event: [pull_request, push, tag]