12 image: clux/muslrust:1.60.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
25 - name: check lemmy_api_common with minimal deps
26 image: clux/muslrust:1.60.0
28 - cargo check -p lemmy_api_common
31 image: clux/muslrust:1.60.0
33 - rustup component add clippy
34 - cargo clippy --workspace --tests --all-targets --all-features -- -D warnings -D deprecated -D clippy::perf -D clippy::complexity -D clippy::dbg_macro
35 - cargo clippy --workspace -- -D clippy::unwrap_used
38 image: clux/muslrust:1.60.0
40 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
41 LEMMY_CONFIG_LOCATION: ../../config/config.hjson
46 - apt-get -y install --no-install-recommends postgresql-client
47 - cargo test --workspace --no-fail-fast
49 - name: check defaults.hjson updated
50 image: clux/muslrust:1.60.0
52 - ./scripts/update_config_defaults.sh config/defaults_current.hjson
53 - diff config/defaults.hjson config/defaults_current.hjson
56 image: clux/muslrust:1.60.0
59 - mv target/x86_64-unknown-linux-musl/debug/lemmy_server target/lemmy_server
61 - name: run federation tests
64 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
65 DO_WRITE_HOSTS_FILE: 1
67 - apk add bash curl postgresql-client
68 - bash api_tests/prepare-drone-federation-test.sh
73 - name: publish release docker image
76 dockerfile: docker/prod/Dockerfile
78 from_secret: docker_username
80 from_secret: docker_password
81 repo: dessalines/lemmy
83 auto_tag_suffix: linux-amd64
88 - name: publish release docker manifest
89 image: plugins/manifest
92 from_secret: docker_username
94 from_secret: docker_password
95 target: "dessalines/lemmy:${DRONE_TAG}"
96 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
105 - name: publish latest release docker manifest
106 image: plugins/manifest
109 from_secret: docker_username
111 from_secret: docker_password
112 target: "dessalines/lemmy:latest"
113 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
122 # using https://github.com/pksunkara/cargo-workspaces
123 - name: publish to crates.io
124 image: rustlang/rust:nightly
127 from_secret: cargo_api_token
129 - cargo install cargo-workspaces
130 - cp -r migrations crates/db_schema/
131 - cargo login "$CARGO_TOKEN"
132 - cargo workspaces publish --from-git --allow-dirty --allow-branch "${DRONE_TAG}" --yes custom "${DRONE_TAG}"
139 image: postgres:12-alpine
142 POSTGRES_PASSWORD: password
155 image: rust:1.60-slim
158 - chown 1000:1000 . -R
160 - apt install --no-install-recommends --yes git
163 - git submodule update --recursive --remote
165 # TODO temporarily disable arm tests
167 # image: rust:1.60-slim
169 # LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
170 # LEMMY_CONFIG_LOCATION: ../../config/config.hjson
172 # RUST_TEST_THREADS: 1
175 # - apt-get -y install --no-install-recommends postgresql-client libssl-dev pkg-config libpq-dev
176 # - cargo test --workspace --no-fail-fast
179 # TODO temporarily disable arm tests
180 # Using Debian here because there seems to be no official Alpine-based Rust docker image for ARM.
181 # - name: cargo build
182 # image: rust:1.60-slim
185 # - apt-get -y install --no-install-recommends libssl-dev pkg-config libpq-dev
187 # - mv target/debug/lemmy_server target/lemmy_server
189 # TODO temporarily disable arm tests
190 # - name: run federation tests
191 # image: node:16-slim
193 # LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
194 # DO_WRITE_HOSTS_FILE: 1
196 # - mkdir -p /usr/share/man/man1 /usr/share/man/man7
198 # - apt-get -y install --no-install-recommends bash curl libssl-dev pkg-config libpq-dev postgresql-client libc6-dev
199 # - bash api_tests/prepare-drone-federation-test.sh
204 - name: publish release docker image
205 image: plugins/docker
207 dockerfile: docker/prod/Dockerfile.arm
209 from_secret: docker_username
211 from_secret: docker_password
212 repo: dessalines/lemmy
214 auto_tag_suffix: linux-arm64
219 - name: publish release docker manifest
220 image: plugins/manifest
223 from_secret: docker_username
225 from_secret: docker_password
226 target: "dessalines/lemmy:${DRONE_TAG}"
227 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
236 - name: publish latest release docker manifest
237 image: plugins/manifest
240 from_secret: docker_username
242 from_secret: docker_password
243 target: "dessalines/lemmy:latest"
244 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
253 # TODO temporarily disable arm tests
256 # image: postgres:12-alpine
258 # POSTGRES_USER: lemmy
259 # POSTGRES_PASSWORD: password