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
26 image: clux/muslrust:1.59.0
28 - rustup component add clippy
29 - cargo clippy --workspace --tests --all-targets --all-features -- -D warnings -D deprecated -D clippy::perf -D clippy::complexity -D clippy::dbg_macro
30 - cargo clippy --workspace -- -D clippy::unwrap_used
33 image: clux/muslrust:1.59.0
35 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
36 LEMMY_CONFIG_LOCATION: ../../config/config.hjson
41 - apt-get -y install --no-install-recommends postgresql-client
42 - cargo test --workspace --no-fail-fast
44 - name: check defaults.hjson updated
45 image: clux/muslrust:1.59.0
47 - ./scripts/update_config_defaults.sh config/defaults_current.hjson
48 - diff config/defaults.hjson config/defaults_current.hjson
50 - name: check with different features
51 image: clux/muslrust:1.59.0
53 - cargo install cargo-workspaces
54 - cargo workspaces exec cargo check --no-default-features
55 - cargo workspaces exec cargo check --all-features
58 image: clux/muslrust:1.59.0
61 - mv target/x86_64-unknown-linux-musl/debug/lemmy_server target/lemmy_server
63 - name: run federation tests
66 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
67 DO_WRITE_HOSTS_FILE: 1
69 - apk add bash curl postgresql-client
70 - bash api_tests/prepare-drone-federation-test.sh
78 dockerfile: docker/dev/Dockerfile
80 from_secret: docker_username
82 from_secret: docker_password
83 repo: dessalines/lemmy
90 - name: publish release docker image
93 dockerfile: docker/prod/Dockerfile
95 from_secret: docker_username
97 from_secret: docker_password
98 repo: dessalines/lemmy
100 auto_tag_suffix: linux-amd64
105 - name: publish release docker manifest
106 image: plugins/manifest
109 from_secret: docker_username
111 from_secret: docker_password
112 target: "dessalines/lemmy:${DRONE_TAG}"
113 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
122 - name: publish latest release docker manifest
123 image: plugins/manifest
126 from_secret: docker_username
128 from_secret: docker_password
129 target: "dessalines/lemmy:latest"
130 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
139 # using https://github.com/pksunkara/cargo-workspaces
140 - name: publish to crates.io
141 image: rustlang/rust:nightly
144 from_secret: cargo_api_token
146 - cargo install cargo-workspaces
147 - cp -r migrations crates/db_schema/
148 - cargo login "$CARGO_TOKEN"
149 - cargo workspaces publish --from-git --allow-dirty --allow-branch "${DRONE_TAG}" --yes custom "${DRONE_TAG}"
156 image: postgres:12-alpine
159 POSTGRES_PASSWORD: password
172 image: rust:1.60-slim
175 - chown 1000:1000 . -R
177 - apt install --no-install-recommends --yes git
180 - git submodule update --recursive --remote
182 # TODO temporarily disable arm tests
184 # image: rust:1.60-slim
186 # LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
187 # LEMMY_CONFIG_LOCATION: ../../config/config.hjson
189 # RUST_TEST_THREADS: 1
192 # - apt-get -y install --no-install-recommends postgresql-client libssl-dev pkg-config libpq-dev
193 # - cargo test --workspace --no-fail-fast
196 # TODO temporarily disable arm tests
197 # Using Debian here because there seems to be no official Alpine-based Rust docker image for ARM.
198 # - name: cargo build
199 # image: rust:1.60-slim
202 # - apt-get -y install --no-install-recommends libssl-dev pkg-config libpq-dev
204 # - mv target/debug/lemmy_server target/lemmy_server
206 # TODO temporarily disable arm tests
207 # - name: run federation tests
208 # image: node:16-slim
210 # LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
211 # DO_WRITE_HOSTS_FILE: 1
213 # - mkdir -p /usr/share/man/man1 /usr/share/man/man7
215 # - apt-get -y install --no-install-recommends bash curl libssl-dev pkg-config libpq-dev postgresql-client libc6-dev
216 # - bash api_tests/prepare-drone-federation-test.sh
221 - name: publish release docker image
222 image: plugins/docker
224 dockerfile: docker/prod/Dockerfile.arm
226 from_secret: docker_username
228 from_secret: docker_password
229 repo: dessalines/lemmy
231 auto_tag_suffix: linux-arm64
236 - name: publish release docker manifest
237 image: plugins/manifest
240 from_secret: docker_username
242 from_secret: docker_password
243 target: "dessalines/lemmy:${DRONE_TAG}"
244 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
253 - name: publish latest release docker manifest
254 image: plugins/manifest
257 from_secret: docker_username
259 from_secret: docker_password
260 target: "dessalines/lemmy:latest"
261 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
270 # TODO temporarily disable arm tests
273 # image: postgres:12-alpine
275 # POSTGRES_USER: lemmy
276 # POSTGRES_PASSWORD: password