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
78 - name: publish release docker image
81 dockerfile: docker/prod/Dockerfile
83 from_secret: docker_username
85 from_secret: docker_password
86 repo: dessalines/lemmy
88 auto_tag_suffix: linux-amd64
93 - name: publish release docker manifest
94 image: plugins/manifest
97 from_secret: docker_username
99 from_secret: docker_password
100 target: "dessalines/lemmy:${DRONE_TAG}"
101 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
110 - name: publish latest release docker manifest
111 image: plugins/manifest
114 from_secret: docker_username
116 from_secret: docker_password
117 target: "dessalines/lemmy:latest"
118 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
127 # using https://github.com/pksunkara/cargo-workspaces
128 - name: publish to crates.io
129 image: rustlang/rust:nightly
132 from_secret: cargo_api_token
134 - cargo install cargo-workspaces
135 - cp -r migrations crates/db_schema/
136 - cargo login "$CARGO_TOKEN"
137 - cargo workspaces publish --from-git --allow-dirty --allow-branch "${DRONE_TAG}" --yes custom "${DRONE_TAG}"
144 image: postgres:12-alpine
147 POSTGRES_PASSWORD: password
160 image: rust:1.60-slim
163 - chown 1000:1000 . -R
165 - apt install --no-install-recommends --yes git
168 - git submodule update --recursive --remote
170 # TODO temporarily disable arm tests
172 # image: rust:1.60-slim
174 # LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
175 # LEMMY_CONFIG_LOCATION: ../../config/config.hjson
177 # RUST_TEST_THREADS: 1
180 # - apt-get -y install --no-install-recommends postgresql-client libssl-dev pkg-config libpq-dev
181 # - cargo test --workspace --no-fail-fast
184 # TODO temporarily disable arm tests
185 # Using Debian here because there seems to be no official Alpine-based Rust docker image for ARM.
186 # - name: cargo build
187 # image: rust:1.60-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 # TODO temporarily disable arm tests
195 # - name: run federation tests
196 # image: node:16-slim
198 # LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
199 # DO_WRITE_HOSTS_FILE: 1
201 # - mkdir -p /usr/share/man/man1 /usr/share/man/man7
203 # - apt-get -y install --no-install-recommends bash curl libssl-dev pkg-config libpq-dev postgresql-client libc6-dev
204 # - bash api_tests/prepare-drone-federation-test.sh
209 - name: publish release docker image
210 image: plugins/docker
212 dockerfile: docker/prod/Dockerfile.arm
214 from_secret: docker_username
216 from_secret: docker_password
217 repo: dessalines/lemmy
219 auto_tag_suffix: linux-arm64
224 - name: publish release docker manifest
225 image: plugins/manifest
228 from_secret: docker_username
230 from_secret: docker_password
231 target: "dessalines/lemmy:${DRONE_TAG}"
232 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
241 - name: publish latest release docker manifest
242 image: plugins/manifest
245 from_secret: docker_username
247 from_secret: docker_password
248 target: "dessalines/lemmy:latest"
249 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
258 # TODO temporarily disable arm tests
261 # image: postgres:12-alpine
263 # POSTGRES_USER: lemmy
264 # POSTGRES_PASSWORD: password