12 image: clux/muslrust:1.56.0
15 - chown 1000:1000 . -R
18 - git submodule update --recursive --remote
20 - name: check formatting
21 image: rustdocker/rust:nightly
23 - /root/.cargo/bin/cargo fmt -- --check
26 image: clux/muslrust:1.56.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.56.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.56.0
47 - ./scripts/update_config_defaults.sh config/defaults_current.hjson
48 - diff config/defaults.hjson config/defaults_current.hjson
51 image: clux/muslrust:1.56.0
54 - mv target/x86_64-unknown-linux-musl/debug/lemmy_server target/lemmy_server
56 - name: run federation tests
59 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
60 DO_WRITE_HOSTS_FILE: 1
62 - apk add bash curl postgresql-client
63 - bash api_tests/prepare-drone-federation-test.sh
68 - name: publish release docker image
71 dockerfile: docker/prod/Dockerfile
73 from_secret: docker_username
75 from_secret: docker_password
76 repo: dessalines/lemmy
78 auto_tag_suffix: linux-amd64
83 - name: publish release docker manifest
84 image: plugins/manifest
87 from_secret: docker_username
89 from_secret: docker_password
90 target: "dessalines/lemmy:${DRONE_TAG}"
91 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
100 - name: publish latest release docker manifest
101 image: plugins/manifest
104 from_secret: docker_username
106 from_secret: docker_password
107 target: "dessalines/lemmy:latest"
108 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
117 # using https://github.com/pksunkara/cargo-workspaces
118 - name: publish to crates.io
119 image: rustlang/rust:nightly
122 from_secret: cargo_api_token
124 - cargo install cargo-workspaces
125 - cp -r migrations crates/db_schema/
126 - cargo login "$CARGO_TOKEN"
127 - cargo workspaces publish --from-git --allow-dirty --allow-branch "${DRONE_TAG}" --yes custom "${DRONE_TAG}"
134 image: postgres:12-alpine
137 POSTGRES_PASSWORD: password
150 image: rust:1.56-slim
153 - chown 1000:1000 . -R
155 - apt install --no-install-recommends --yes git
158 - git submodule update --recursive --remote
160 # TODO temporarily disable arm tests
162 # image: rust:1.56-slim
164 # LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
165 # LEMMY_CONFIG_LOCATION: ../../config/config.hjson
167 # RUST_TEST_THREADS: 1
170 # - apt-get -y install --no-install-recommends postgresql-client libssl-dev pkg-config libpq-dev
171 # - cargo test --workspace --no-fail-fast
174 # TODO temporarily disable arm tests
175 # Using Debian here because there seems to be no official Alpine-based Rust docker image for ARM.
176 # - name: cargo build
177 # image: rust:1.56-slim
180 # - apt-get -y install --no-install-recommends libssl-dev pkg-config libpq-dev
182 # - mv target/debug/lemmy_server target/lemmy_server
184 # TODO temporarily disable arm tests
185 # - name: run federation tests
186 # image: node:16-slim
188 # LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
189 # DO_WRITE_HOSTS_FILE: 1
191 # - mkdir -p /usr/share/man/man1 /usr/share/man/man7
193 # - apt-get -y install --no-install-recommends bash curl libssl-dev pkg-config libpq-dev postgresql-client libc6-dev
194 # - bash api_tests/prepare-drone-federation-test.sh
199 - name: publish release docker image
200 image: plugins/docker
202 dockerfile: docker/prod/Dockerfile.arm
204 from_secret: docker_username
206 from_secret: docker_password
207 repo: dessalines/lemmy
209 auto_tag_suffix: linux-arm64
214 - name: publish release docker manifest
215 image: plugins/manifest
218 from_secret: docker_username
220 from_secret: docker_password
221 target: "dessalines/lemmy:${DRONE_TAG}"
222 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
231 - name: publish latest release docker manifest
232 image: plugins/manifest
235 from_secret: docker_username
237 from_secret: docker_password
238 target: "dessalines/lemmy:latest"
239 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
248 # TODO temporarily disable arm tests
251 # image: postgres:12-alpine
253 # POSTGRES_USER: lemmy
254 # POSTGRES_PASSWORD: password