12 image: clux/muslrust:1.59.0
17 - git submodule update --recursive --remote
18 - chown 1000:1000 . -R
20 - name: check formatting
21 image: rustdocker/rust:nightly
23 - /root/.cargo/bin/cargo fmt -- --check
25 - name: check with different features
26 image: clux/muslrust:1.59.0
28 # api with minimal deps
29 - cargo check -p lemmy_api_common
30 # opentelemetry console
31 - cargo check --features console
36 image: clux/muslrust:1.59.0
38 - rustup component add clippy
39 - cargo clippy --workspace --tests --all-targets --all-features -- -D warnings -D deprecated -D clippy::perf -D clippy::complexity -D clippy::dbg_macro
40 - cargo clippy --workspace -- -D clippy::unwrap_used
43 image: clux/muslrust:1.59.0
45 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
46 LEMMY_CONFIG_LOCATION: ../../config/config.hjson
51 - apt-get -y install --no-install-recommends postgresql-client
52 - cargo test --workspace --no-fail-fast
54 - name: check defaults.hjson updated
55 image: clux/muslrust:1.59.0
57 - ./scripts/update_config_defaults.sh config/defaults_current.hjson
58 - diff config/defaults.hjson config/defaults_current.hjson
61 image: clux/muslrust:1.59.0
64 - mv target/x86_64-unknown-linux-musl/debug/lemmy_server target/lemmy_server
66 - name: run federation tests
69 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
70 DO_WRITE_HOSTS_FILE: 1
72 - apk add bash curl postgresql-client
73 - bash api_tests/prepare-drone-federation-test.sh
81 dockerfile: docker/dev/Dockerfile
83 from_secret: docker_username
85 from_secret: docker_password
86 repo: dessalines/lemmy
93 - name: publish release docker image
96 dockerfile: docker/prod/Dockerfile
98 from_secret: docker_username
100 from_secret: docker_password
101 repo: dessalines/lemmy
103 auto_tag_suffix: linux-amd64
108 - name: publish release docker manifest
109 image: plugins/manifest
112 from_secret: docker_username
114 from_secret: docker_password
115 target: "dessalines/lemmy:${DRONE_TAG}"
116 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
125 - name: publish latest release docker manifest
126 image: plugins/manifest
129 from_secret: docker_username
131 from_secret: docker_password
132 target: "dessalines/lemmy:latest"
133 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
142 # using https://github.com/pksunkara/cargo-workspaces
143 - name: publish to crates.io
144 image: rustlang/rust:nightly
147 from_secret: cargo_api_token
149 - cargo install cargo-workspaces
150 - cp -r migrations crates/db_schema/
151 - cargo login "$CARGO_TOKEN"
152 - cargo workspaces publish --from-git --allow-dirty --allow-branch "${DRONE_TAG}" --yes custom "${DRONE_TAG}"
159 image: postgres:12-alpine
162 POSTGRES_PASSWORD: password
175 image: rust:1.60-slim
178 - chown 1000:1000 . -R
180 - apt install --no-install-recommends --yes git
183 - git submodule update --recursive --remote
185 # TODO temporarily disable arm tests
187 # image: rust:1.60-slim
189 # LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
190 # LEMMY_CONFIG_LOCATION: ../../config/config.hjson
192 # RUST_TEST_THREADS: 1
195 # - apt-get -y install --no-install-recommends postgresql-client libssl-dev pkg-config libpq-dev
196 # - cargo test --workspace --no-fail-fast
199 # TODO temporarily disable arm tests
200 # Using Debian here because there seems to be no official Alpine-based Rust docker image for ARM.
201 # - name: cargo build
202 # image: rust:1.60-slim
205 # - apt-get -y install --no-install-recommends libssl-dev pkg-config libpq-dev
207 # - mv target/debug/lemmy_server target/lemmy_server
209 # TODO temporarily disable arm tests
210 # - name: run federation tests
211 # image: node:16-slim
213 # LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
214 # DO_WRITE_HOSTS_FILE: 1
216 # - mkdir -p /usr/share/man/man1 /usr/share/man/man7
218 # - apt-get -y install --no-install-recommends bash curl libssl-dev pkg-config libpq-dev postgresql-client libc6-dev
219 # - bash api_tests/prepare-drone-federation-test.sh
224 - name: publish release docker image
225 image: plugins/docker
227 dockerfile: docker/prod/Dockerfile.arm
229 from_secret: docker_username
231 from_secret: docker_password
232 repo: dessalines/lemmy
234 auto_tag_suffix: linux-arm64
239 - name: publish release docker manifest
240 image: plugins/manifest
243 from_secret: docker_username
245 from_secret: docker_password
246 target: "dessalines/lemmy:${DRONE_TAG}"
247 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
256 - name: publish latest release docker manifest
257 image: plugins/manifest
260 from_secret: docker_username
262 from_secret: docker_password
263 target: "dessalines/lemmy:latest"
264 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
273 # TODO temporarily disable arm tests
276 # image: postgres:12-alpine
278 # POSTGRES_USER: lemmy
279 # POSTGRES_PASSWORD: password