lemmy/.drone.yml

86 lines
2.8 KiB
YAML

kind: pipeline
name: default
steps:
- name: install deps
# we need to use this experimental image because the normal rust-musl-builder doesnt
# allow building as root (and drone doesnt have an easy way to git clone as non-root)
# https://github.com/emk/rust-musl-builder/issues/96
image: ekidd/rust-musl-builder:experimental-stable
user: root
commands:
- apt-get -y update
- apt-get -y install --no-install-recommends espeak postgresql-client
- cargo install diesel_cli --no-default-features --features postgres
- name: cargo check
image: ekidd/rust-musl-builder:experimental-stable
user: root
commands:
- cargo check --all
- name: cargo clippy
image: ekidd/rust-musl-builder:experimental-stable
user: root
commands:
- cargo clippy
- name: check documentation build
image: ekidd/rust-musl-builder:experimental-stable
user: root
commands:
- mdbook build docs/
- name: cargo test
image: ekidd/rust-musl-builder:experimental-stable
user: root
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
commands:
- /root/.cargo/bin/diesel migration run
- cargo test --workspace --no-fail-fast
- name: run federation tests
image: docker/compose:alpine-1.27.4
commands:
- cd docker/travis/
- mkdir -p volumes/pictrs_{alpha,beta,gamma,delta,epsilon}
- chown -R 991:991 volumes/pictrs_{alpha,beta,gamma,delta,epsilon}
- docker-compose up -d
- pushd ../../api_tests
- echo "Waiting for Lemmy to start..."
- while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8541/api/v1/site')" != "200" ]]; do sleep 1; done
- while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8551/api/v1/site')" != "200" ]]; do sleep 1; done
- while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8561/api/v1/site')" != "200" ]]; do sleep 1; done
- while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8571/api/v1/site')" != "200" ]]; do sleep 1; done
- while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8581/api/v1/site')" != "200" ]]; do sleep 1; done
- yarn
- yarn api-test
- popd
- docker-compose down
- name: make release build and push to docker hub
image: plugins/docker
settings:
dockerfile: docker/prod/Dockerfile
username: kevinbacon
password: pa55word
repo: dessalines/lemmy
purge: true
tags:
- latest
when:
ref:
- refs/heads/feature-*
- refs/tags/*
services:
- name: database
image: postgres:12-alpine
environment:
POSTGRES_USER: lemmy
POSTGRES_PASSWORD: password