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
41 - name: check defaults.hjson updated
42 image: ekidd/rust-musl-builder:1.51.0
44 - ./scripts/update_config_defaults.sh config/defaults_current.hjson
45 - diff config/defaults.hjson config/defaults_current.hjson
48 image: ekidd/rust-musl-builder:1.51.0
51 - mv target/x86_64-unknown-linux-musl/debug/lemmy_server target/lemmy_server
53 - name: run federation tests
56 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
57 DO_WRITE_HOSTS_FILE: 1
59 - apk add bash curl postgresql-client
60 - bash api_tests/prepare-drone-federation-test.sh
65 - name: publish dev docker image
68 dockerfile: docker/prod/Dockerfile
70 from_secret: docker_username
72 from_secret: docker_password
73 repo: dessalines/lemmy
80 - name: publish dev docker manifest
81 image: plugins/manifest
84 from_secret: docker_username
86 from_secret: docker_password
87 target: "dessalines/lemmy:dev"
88 template: "dessalines/lemmy:dev-OS-ARCH"
97 - name: publish release docker image
100 dockerfile: docker/prod/Dockerfile
102 from_secret: docker_username
104 from_secret: docker_password
105 repo: dessalines/lemmy
107 auto_tag_suffix: linux-amd64
112 - name: publish release docker manifest
113 image: plugins/manifest
116 from_secret: docker_username
118 from_secret: docker_password
119 target: "dessalines/lemmy:${DRONE_TAG}"
120 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
129 # using https://github.com/pksunkara/cargo-workspaces
130 - name: publish to crates.io
131 image: rustlang/rust:nightly
134 from_secret: cargo_api_token
136 - cargo install cargo-workspaces
137 - cp -r migrations crates/db_schema/
138 - cargo login "$CARGO_TOKEN"
139 - cargo workspaces publish --from-git --allow-dirty --allow-branch "${DRONE_TAG}" --yes custom "${DRONE_TAG}"
146 image: postgres:12-alpine
149 POSTGRES_PASSWORD: password
162 # Not sure why, but rust ARM64 builds are failing on drone for rust:1.54 and later:
163 # https://discourse.drone.io/t/arm-build-stalls-out-on-cloud-drone-io-ram-issue/9701
164 image: rust:1.51-slim
167 - chown 1000:1000 . -R
169 - apt install --no-install-recommends --yes git
173 image: rust:1.51-slim
175 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
176 LEMMY_CONFIG_LOCATION: ../../config/config.hjson
181 - apt-get -y install --no-install-recommends postgresql-client libssl-dev pkg-config libpq-dev
182 - cargo test --workspace --no-fail-fast
185 # Using Debian here because there seems to be no official Alpine-based Rust docker image for ARM.
187 image: rust:1.51-slim
190 - apt-get -y install --no-install-recommends libssl-dev pkg-config libpq-dev
192 - mv target/debug/lemmy_server target/lemmy_server
194 - name: run federation tests
197 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
198 DO_WRITE_HOSTS_FILE: 1
200 - mkdir -p /usr/share/man/man1 /usr/share/man/man7
202 - apt-get -y install --no-install-recommends bash curl libssl-dev pkg-config libpq-dev postgresql-client libc6-dev
203 - bash api_tests/prepare-drone-federation-test.sh
208 - name: publish dev docker image
209 image: plugins/docker
211 dockerfile: docker/prod/Dockerfile.arm
213 from_secret: docker_username
215 from_secret: docker_password
216 repo: dessalines/lemmy
223 - name: publish dev docker manifest
224 image: plugins/manifest
227 from_secret: docker_username
229 from_secret: docker_password
230 target: "dessalines/lemmy:dev"
231 template: "dessalines/lemmy:dev-OS-ARCH"
240 - name: publish release docker image
241 image: plugins/docker
243 dockerfile: docker/prod/Dockerfile.arm
245 from_secret: docker_username
247 from_secret: docker_password
248 repo: dessalines/lemmy
250 auto_tag_suffix: linux-arm64
255 - name: publish release docker manifest
256 image: plugins/manifest
259 from_secret: docker_username
261 from_secret: docker_password
262 target: "dessalines/lemmy:${DRONE_TAG}"
263 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
274 image: postgres:12-alpine
277 POSTGRES_PASSWORD: password