12 image: ekidd/rust-musl-builder:1.51.0
15 - chown 1000:1000 . -R
18 - name: check formatting
19 image: rustdocker/rust:nightly
21 - /root/.cargo/bin/cargo fmt -- --check
24 image: ekidd/rust-musl-builder:1.51.0
26 - cargo clippy --workspace --tests --all-targets --all-features -- -D warnings -D deprecated -D clippy::perf -D clippy::complexity -D clippy::dbg_macro
27 - cargo clippy --workspace -- -D clippy::unwrap_used
30 image: ekidd/rust-musl-builder:1.51.0
32 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
33 LEMMY_CONFIG_LOCATION: ../../config/config.hjson
38 - sudo apt-get -y install --no-install-recommends postgresql-client
39 - cargo test --workspace --no-fail-fast
41 - name: check defaults.hjson updated
42 image: ekidd/rust-musl-builder:1.51.0
44 - ./scripts/update_config_defaults.sh config/defaults_current.hjson
45 - diff config/defaults.hjson config/defaults_current.hjson
48 image: ekidd/rust-musl-builder:1.51.0
51 - mv target/x86_64-unknown-linux-musl/debug/lemmy_server target/lemmy_server
53 - name: run federation tests
56 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
57 DO_WRITE_HOSTS_FILE: 1
59 - apk add bash curl postgresql-client
60 - bash api_tests/prepare-drone-federation-test.sh
65 - name: publish release docker image
68 dockerfile: docker/prod/Dockerfile
70 from_secret: docker_username
72 from_secret: docker_password
73 repo: dessalines/lemmy
75 auto_tag_suffix: linux-amd64
80 - name: publish release docker manifest
81 image: plugins/manifest
84 from_secret: docker_username
86 from_secret: docker_password
87 target: "dessalines/lemmy:${DRONE_TAG}"
88 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
97 # using https://github.com/pksunkara/cargo-workspaces
98 - name: publish to crates.io
99 image: rustlang/rust:nightly
102 from_secret: cargo_api_token
104 - cargo install cargo-workspaces
105 - cp -r migrations crates/db_schema/
106 - cargo login "$CARGO_TOKEN"
107 - cargo workspaces publish --from-git --allow-dirty --allow-branch "${DRONE_TAG}" --yes custom "${DRONE_TAG}"
114 image: postgres:12-alpine
117 POSTGRES_PASSWORD: password
130 # Not sure why, but rust ARM64 builds are failing on drone for rust:1.54 and later:
131 # https://discourse.drone.io/t/arm-build-stalls-out-on-cloud-drone-io-ram-issue/9701
132 image: rust:1.51-slim
135 - chown 1000:1000 . -R
137 - apt install --no-install-recommends --yes git
141 image: rust:1.51-slim
143 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
144 LEMMY_CONFIG_LOCATION: ../../config/config.hjson
149 - apt-get -y install --no-install-recommends postgresql-client libssl-dev pkg-config libpq-dev
150 - cargo test --workspace --no-fail-fast
153 # Using Debian here because there seems to be no official Alpine-based Rust docker image for ARM.
155 image: rust:1.51-slim
158 - apt-get -y install --no-install-recommends libssl-dev pkg-config libpq-dev
160 - mv target/debug/lemmy_server target/lemmy_server
162 - name: run federation tests
165 LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
166 DO_WRITE_HOSTS_FILE: 1
168 - mkdir -p /usr/share/man/man1 /usr/share/man/man7
170 - apt-get -y install --no-install-recommends bash curl libssl-dev pkg-config libpq-dev postgresql-client libc6-dev
171 - bash api_tests/prepare-drone-federation-test.sh
176 - name: publish release docker image
177 image: plugins/docker
179 dockerfile: docker/prod/Dockerfile.arm
181 from_secret: docker_username
183 from_secret: docker_password
184 repo: dessalines/lemmy
186 auto_tag_suffix: linux-arm64
191 - name: publish release docker manifest
192 image: plugins/manifest
195 from_secret: docker_username
197 from_secret: docker_password
198 target: "dessalines/lemmy:${DRONE_TAG}"
199 template: "dessalines/lemmy:${DRONE_TAG}-OS-ARCH"
210 image: postgres:12-alpine
213 POSTGRES_PASSWORD: password