1 # TODO: The when: platform conditionals aren't working currently
2 # See https://github.com/woodpecker-ci/woodpecker/issues/1677
5 - &muslrust_image "clux/muslrust:1.70.0"
7 # Broken for cron jobs currently, see
8 # https://github.com/woodpecker-ci/woodpecker/issues/1716
11 # image: woodpeckerci/plugin-git
14 # submodule_update_remote: true
22 - git submodule update
25 image: tmknom/prettier:3.0.0
27 - prettier -c . '!**/volumes' '!**/dist' '!target' '!**/translations'
30 image: meltwater/drone-cache:v1
35 from_secret: MINIO_ENDPOINT
37 from_secret: MINIO_WRITE_USER
39 from_secret: MINIO_WRITE_PASSWORD
41 from_secret: MINIO_BUCKET
43 cache_key: "rust-cache"
48 - "api_tests/node_modules"
50 [MINIO_ENDPOINT, MINIO_WRITE_USER, MINIO_WRITE_PASSWORD, MINIO_BUCKET]
53 image: tamasfe/taplo:0.8.1
55 - taplo format --check
58 image: *muslrust_image
60 # store cargo data in repo folder so that it gets cached between steps
63 # need make existing toolchain available
65 - rustup toolchain install nightly-2023-07-10
66 - rustup component add rustfmt --toolchain nightly-2023-07-10
67 - cargo +nightly-2023-07-10 fmt -- --check
69 # platform: linux/amd64
71 # make sure api builds with default features (used by other crates relying on lemmy api)
72 check_api_common_default_features:
73 image: *muslrust_image
77 - cargo check --package lemmy_api_common
79 # platform: linux/amd64
81 lemmy_api_common_doesnt_depend_on_diesel:
82 image: *muslrust_image
86 - "! cargo tree -p lemmy_api_common --no-default-features -i diesel"
88 # platform: linux/amd64
90 lemmy_api_common_works_with_wasm:
91 image: *muslrust_image
95 - "rustup target add wasm32-unknown-unknown"
96 - "cargo check --target wasm32-unknown-unknown -p lemmy_api_common"
98 check_defaults_hjson_updated:
99 image: *muslrust_image
103 - export LEMMY_CONFIG_LOCATION=./config/config.hjson
104 - ./scripts/update_config_defaults.sh config/defaults_current.hjson
105 - diff config/defaults.hjson config/defaults_current.hjson
107 # platform: linux/amd64
110 image: willsquire/diesel-cli
113 DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
115 - diesel migration run
116 - diesel print-schema --config-file=diesel.toml > tmp.schema
117 - diff tmp.schema crates/db_schema/src/schema.rs
119 check_diesel_migration_revertable:
120 image: willsquire/diesel-cli
123 DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
125 - diesel migration run
126 - diesel migration redo
129 image: *muslrust_image
133 # when adding new clippy lints, make sure to also add them in scripts/fix-clippy.sh
134 - rustup component add clippy
135 - cargo clippy --workspace --tests --all-targets --features console --
136 -D warnings -D deprecated -D clippy::perf -D clippy::complexity
137 -D clippy::style -D clippy::correctness -D clippy::suspicious
138 -D clippy::dbg_macro -D clippy::inefficient_to_string
139 -D clippy::items-after-statements -D clippy::implicit_clone
140 -D clippy::cast_lossless -D clippy::manual_string_new
141 -D clippy::redundant_closure_for_method_calls
142 -D clippy::unused_self
143 -A clippy::uninlined_format_args
145 -D clippy::explicit_into_iter_loop
146 -D clippy::explicit_iter_loop
147 -D clippy::needless_collect
148 -D clippy::unwrap_used
149 -D clippy::indexing_slicing
151 # platform: linux/amd64
154 image: *muslrust_image
156 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
160 - export LEMMY_CONFIG_LOCATION=../../config/config.hjson
161 - cargo test --workspace --no-fail-fast
163 # platform: linux/amd64
166 image: *muslrust_image
171 - mv target/x86_64-unknown-linux-musl/debug/lemmy_server target/lemmy_server
173 # platform: linux/amd64
175 run_federation_tests:
178 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
179 DO_WRITE_HOSTS_FILE: "1"
181 - apk add bash curl postgresql-client
182 - bash api_tests/prepare-drone-federation-test.sh
187 # platform: linux/amd64
190 image: meltwater/drone-cache:v1
195 from_secret: MINIO_ENDPOINT
197 from_secret: MINIO_WRITE_USER
199 from_secret: MINIO_WRITE_PASSWORD
201 from_secret: MINIO_BUCKET
202 cache_key: "rust-cache"
208 - "api_tests/node_modules"
210 [MINIO_ENDPOINT, MINIO_WRITE_USER, MINIO_WRITE_PASSWORD, MINIO_BUCKET]
212 publish_release_docker:
213 image: woodpeckerci/plugin-docker-buildx
214 secrets: [docker_username, docker_password]
216 repo: dessalines/lemmy
217 dockerfile: docker/Dockerfile
218 platforms: linux/amd64
220 - RUST_RELEASE_MODE=release
226 image: woodpeckerci/plugin-docker-buildx
227 secrets: [docker_username, docker_password]
229 repo: dessalines/lemmy
230 dockerfile: docker/Dockerfile
231 platforms: linux/amd64
233 - RUST_RELEASE_MODE=release
242 - "curl -d'Lemmy CI build failed: ${CI_BUILD_LINK}' ntfy.sh/lemmy_drone_ci"
246 notify_on_tag_deploy:
250 - "curl -d'lemmy:${CI_COMMIT_TAG} deployed' ntfy.sh/lemmy_drone_ci"
256 image: postgres:15.2-alpine
259 POSTGRES_PASSWORD: password
261 # platform: linux/amd64