12 image: ekidd/rust-musl-builder:1.51.0
15 - chown 1000:1000 . -R
18 - name: check formatting
19 image: rustdocker/rust:nightly
21 - /root/.cargo/bin/cargo fmt -- --check
24 image: ekidd/rust-musl-builder:1.51.0
26 - cargo clippy --workspace --tests --all-targets --all-features -- -D warnings -D deprecated -D clippy::perf -D clippy::complexity -D clippy::dbg_macro
27 - cargo clippy --workspace -- -D clippy::unwrap_used
30 image: ekidd/rust-musl-builder:1.51.0
32 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
33 LEMMY_CONFIG_LOCATION: ../../config/config.hjson
38 - sudo apt-get -y install --no-install-recommends postgresql-client
39 - cargo test --workspace --no-fail-fast
42 image: ekidd/rust-musl-builder:1.51.0
45 - mv target/x86_64-unknown-linux-musl/debug/lemmy_server target/lemmy_server
47 - name: run federation tests
50 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
51 DO_WRITE_HOSTS_FILE: 1
53 - apk add bash curl postgresql-client
54 - bash api_tests/prepare-drone-federation-test.sh
59 - name: publish dev docker image
62 dockerfile: docker/prod/Dockerfile
64 from_secret: docker_username
66 from_secret: docker_password
67 repo: dessalines/lemmy
74 - name: publish dev docker manifest
75 image: plugins/manifest
78 from_secret: docker_username
80 from_secret: docker_password
81 target: "dessalines/lemmy:dev"
82 template: "dessalines/lemmy:dev-OS-ARCH"
91 - name: publish release docker image
94 dockerfile: docker/prod/Dockerfile
96 from_secret: docker_username
98 from_secret: docker_password
99 repo: dessalines/lemmy
101 auto_tag_suffix: linux-amd64
106 - name: publish release docker manifest
107 image: plugins/manifest
110 from_secret: docker_username
112 from_secret: docker_password
113 target: "dessalines/lemmy:${DRONE_TAG}"
114 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
123 # using https://github.com/pksunkara/cargo-workspaces
124 - name: publish to crates.io
128 from_secret: cargo_api_token
130 - cargo install cargo-workspaces
131 - cp -r migrations crates/db_queries/
132 - cargo login "$CARGO_TOKEN"
133 - cargo workspaces publish --from-git --allow-dirty --allow-branch "${DRONE_TAG}" --yes custom "${DRONE_TAG}"
140 image: postgres:12-alpine
143 POSTGRES_PASSWORD: password
156 # Not sure why, but rust ARM64 builds are failing on drone for rust:1.54 and later:
157 # https://discourse.drone.io/t/arm-build-stalls-out-on-cloud-drone-io-ram-issue/9701
158 image: rust:1.51-slim
161 - chown 1000:1000 . -R
163 - apt install --no-install-recommends --yes git
167 image: rust:1.51-slim
169 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
170 LEMMY_CONFIG_LOCATION: ../../config/config.hjson
175 - apt-get -y install --no-install-recommends postgresql-client libssl-dev pkg-config libpq-dev
176 - cargo test --workspace --no-fail-fast
179 # Using Debian here because there seems to be no official Alpine-based Rust docker image for ARM.
181 image: rust:1.51-slim
184 - apt-get -y install --no-install-recommends libssl-dev pkg-config libpq-dev
186 - mv target/debug/lemmy_server target/lemmy_server
188 - name: run federation tests
191 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
192 DO_WRITE_HOSTS_FILE: 1
194 - mkdir -p /usr/share/man/man1 /usr/share/man/man7
196 - apt-get -y install --no-install-recommends bash curl libssl-dev pkg-config libpq-dev postgresql-client libc6-dev
197 - bash api_tests/prepare-drone-federation-test.sh
202 - name: publish dev docker image
203 image: plugins/docker
205 dockerfile: docker/prod/Dockerfile.arm
207 from_secret: docker_username
209 from_secret: docker_password
210 repo: dessalines/lemmy
217 - name: publish dev docker manifest
218 image: plugins/manifest
221 from_secret: docker_username
223 from_secret: docker_password
224 target: "dessalines/lemmy:dev"
225 template: "dessalines/lemmy:dev-OS-ARCH"
234 - name: publish release docker image
235 image: plugins/docker
237 dockerfile: docker/prod/Dockerfile.arm
239 from_secret: docker_username
241 from_secret: docker_password
242 repo: dessalines/lemmy
244 auto_tag_suffix: linux-arm64
249 - name: publish release docker manifest
250 image: plugins/manifest
253 from_secret: docker_username
255 from_secret: docker_password
256 target: "dessalines/lemmy:${DRONE_TAG}"
257 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
268 image: postgres:12-alpine
271 POSTGRES_PASSWORD: password