lemmy/.drone.yml
2020-12-10 20:57:28 +01:00

105 lines
2.7 KiB
YAML

kind: pipeline
name: default
steps:
- name: chown repo
image: ekidd/rust-musl-builder:1.47.0
user: root
commands:
- chown 1000:1000 . -R
- name: cargo check
image: ekidd/rust-musl-builder:1.47.0
commands:
- cargo check --all
- name: cargo clippy
image: ekidd/rust-musl-builder:1.47.0
commands:
- cargo clippy
- name: check documentation build
image: ekidd/rust-musl-builder:1.47.0
commands:
- mdbook build docs/
# this build somehow fails with the 1.47.0 image/without root
- name: install diesel cli
image: ekidd/rust-musl-builder:experimental-stable
user: root
volumes:
- name: dieselcli
path: /dieselcli
commands:
- cargo install diesel_cli --no-default-features --features postgres
- mv /root/.cargo/bin/diesel /dieselcli/diesel
- name: cargo test
image: ekidd/rust-musl-builder:1.47.0
environment:
LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
RUST_BACKTRACE: 1
RUST_TEST_THREADS: 1
volumes:
- name: dieselcli
path: /dieselcli
commands:
- apt-get update
- apt-get -y install --no-install-recommends espeak postgresql-client
- /dieselcli/diesel migration run
- cargo test --workspace --no-fail-fast
# TODO: this uses rust 1.48.0, which doesnt work with config-rs, so federation tests fail
# https://github.com/LemmyNet/lemmy/issues/1270
- name: cargo build
image: ekidd/rust-musl-builder:1.47.0
volumes:
- name: dieselcli
path: /dieselcli
commands:
- cargo build
- name: run federation tests
image: node:15-buster-slim
commands:
- apt-get update
- apt-get -y install --no-install-recommends bash curl postgresql-client
- cd api_tests/
- bash prepare-drone-federation-test.sh
- yarn
- yarn api-test
- name: create docker tags
image: ekidd/rust-musl-builder:1.47.0
commands:
- echo "$(git describe),latest" > .tags
when:
ref:
- refs/tags/*
- name: make release build and push to docker hub
image: plugins/docker
settings:
dockerfile: docker/prod/Dockerfile
#username: kevinbacon
#password: pa55word
repo: dessalines/lemmy
when:
ref:
- refs/tags/*
# TODO: also need to add more databases for federation test
# (or use multiple DBs in the same postgres instance)
services:
- name: database
image: postgres:12-alpine
environment:
POSTGRES_USER: lemmy
POSTGRES_PASSWORD: password
detach: true
volumes:
- name: dieselcli
temp: {}