2024-02-26 10:36:03 +00:00
|
|
|
variables:
|
2024-12-02 21:48:20 +00:00
|
|
|
- &rust_image "docker.io/rust:1.83.0"
|
2024-02-26 10:36:03 +00:00
|
|
|
- &slow_check_paths
|
|
|
|
- path:
|
|
|
|
# rust source code
|
|
|
|
- "crates/**"
|
|
|
|
- "src/**"
|
|
|
|
- "tests/**"
|
|
|
|
- "**/Cargo.toml"
|
|
|
|
- "Cargo.lock"
|
|
|
|
# database migrations
|
|
|
|
- "migrations/**"
|
|
|
|
# config files and scripts used by ci
|
|
|
|
- ".woodpecker.yml"
|
|
|
|
|
|
|
|
steps:
|
|
|
|
toml_fmt:
|
2024-07-31 13:16:17 +01:00
|
|
|
image: docker.io/tamasfe/taplo:0.9.3
|
2024-02-26 10:36:03 +00:00
|
|
|
commands:
|
|
|
|
- taplo format --check
|
|
|
|
|
|
|
|
cargo_machete:
|
|
|
|
image: *rust_image
|
|
|
|
commands:
|
|
|
|
- wget https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz
|
|
|
|
- tar -xvf cargo-binstall-x86_64-unknown-linux-musl.tgz
|
2024-02-28 17:48:25 +00:00
|
|
|
- rm cargo-binstall-x86_64-unknown-linux-musl.tgz
|
|
|
|
- mv cargo-binstall /usr/local/cargo/bin
|
2024-02-26 10:36:03 +00:00
|
|
|
- cargo binstall -y cargo-machete
|
|
|
|
- cargo machete
|
|
|
|
|
|
|
|
ignored_files:
|
|
|
|
image: docker.io/alpine:latest
|
|
|
|
commands:
|
|
|
|
- apk add git
|
|
|
|
- IGNORED=$(git ls-files --cached -i --exclude-standard)
|
|
|
|
- if [[ "$IGNORED" ]]; then echo "Ignored files present:\n$IGNORED\n"; exit 1; fi
|
|
|
|
|
|
|
|
publish_to_crates_io:
|
|
|
|
image: *rust_image
|
|
|
|
commands:
|
|
|
|
- cargo login "$CARGO_REGISTRY_TOKEN"
|
2024-02-28 17:48:25 +00:00
|
|
|
- cargo publish --registry crates-io --no-verify
|
|
|
|
secrets: [cargo_registry_token]
|
2024-02-26 10:36:03 +00:00
|
|
|
when:
|
|
|
|
event: tag
|