-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.woodpecker.yml
More file actions
92 lines (82 loc) · 2.41 KB
/
Copy path.woodpecker.yml
File metadata and controls
92 lines (82 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
variables:
- &rust_image "rust:1.96-slim-bookworm"
- &rust_nightly_image "rustlang/rust:nightly-alpine"
- &install_binstall "wget -q -O- https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz | tar -xvz -C /usr/local/cargo/bin"
steps:
toml_fmt:
image: ghcr.io/shaddydc/taplo
commands:
- taplo format --check
when:
- event: pull_request
cargo_fmt:
image: *rust_nightly_image
commands:
- rustup component add rustfmt --toolchain nightly
- cargo +nightly fmt -- --check
when:
- event: pull_request
cargo_shear:
image: *rust_nightly_image
commands:
- *install_binstall
- cargo binstall -y cargo-shear --disable-strategies compile
- cargo shear --deny-warnings
when:
- event: pull_request
cargo_clippy:
image: *rust_image
commands:
- apt update && apt install pkg-config libssl-dev -y
- rustup component add clippy
- cargo clippy --tests --all-targets -- -D warnings
when:
- event: pull_request
cargo_build:
image: *rust_image
commands:
- apt update && apt install pkg-config libssl-dev -y
- cargo build
when:
- event: pull_request
cargo_test:
image: *rust_image
environment:
RUST_BACKTRACE: "1"
commands:
- apt update && apt install pkg-config libssl-dev -y
- cargo test --no-fail-fast
when:
- event: pull_request
publish_to_crates_io:
image: *rust_image
environment:
CARGO_API_TOKEN:
from_secret: cargo_api_token
commands:
- cargo publish --allow-dirty --no-verify --token "$CARGO_API_TOKEN"
when:
- event: tag
notify_success:
image: alpine:3
commands:
- apk add curl
- "curl -H'Title: ✔️ ${CI_REPO_NAME}/${CI_COMMIT_SOURCE_BRANCH}' -d'${CI_PIPELINE_URL}' ntfy.sh/lemmy_drone_ci"
when:
- event: pull_request
status: [success]
notify_failure:
image: alpine:3
commands:
- apk add curl
- "curl -H'Title: ❌ ${CI_REPO_NAME}/${CI_COMMIT_SOURCE_BRANCH}' -d'${CI_PIPELINE_URL}' ntfy.sh/lemmy_drone_ci"
when:
- event: pull_request
status: [failure]
notify_on_tag_deploy:
image: alpine:3
commands:
- apk add curl
- "curl -H'Title: ${CI_REPO_NAME}:${CI_COMMIT_TAG} deployed' -d'${CI_PIPELINE_URL}' ntfy.sh/lemmy_drone_ci"
when:
event: tag