]> Untitled Git - lemmy.git/blob - .drone.yml
use apk add, remove diesel migrate from test.sh
[lemmy.git] / .drone.yml
1 kind: pipeline
2 name: default
3
4 steps:
5
6   - name: chown repo
7     image: ekidd/rust-musl-builder:1.47.0
8     user: root
9     commands:
10       - chown 1000:1000 . -R
11
12   - name: check formatting
13     image: rustdocker/rust:nightly
14     commands:
15       - /root/.cargo/bin/cargo fmt -- --check
16
17   - name: cargo check
18     image: ekidd/rust-musl-builder:1.47.0
19     commands:
20       - cargo check --workspace --all-targets
21
22   - name: cargo clippy
23     image: ekidd/rust-musl-builder:1.47.0
24     commands:
25       - cargo clippy
26
27   - name: check documentation build
28     image: ekidd/rust-musl-builder:1.47.0
29     commands:
30       - mdbook build docs/
31
32   - name: cargo test
33     image: ekidd/rust-musl-builder:1.47.0
34     environment:
35       LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
36       DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
37       RUST_BACKTRACE: 1
38       RUST_TEST_THREADS: 1
39     commands:
40       - sudo apt-get update
41       - sudo apt-get -y install --no-install-recommends espeak postgresql-client
42       - cargo test --workspace --no-fail-fast
43
44   - name: cargo build
45     image: ekidd/rust-musl-builder:1.47.0
46     commands:
47       - cargo build
48
49   - name: run federation tests
50     image: node:15-alpine3.12
51     commands:
52       - apk add bash curl postgresql-client
53       - bash api_tests/prepare-drone-federation-test.sh
54       - cd api_tests/
55       - yarn
56       - yarn api-test
57
58   - name: create docker tags
59     image: ekidd/rust-musl-builder:1.47.0
60     commands:
61       - echo "$(git describe),latest" > .tags
62     when:
63       ref:
64       - refs/tags/*
65
66   - name: make release build and push to docker hub
67     image: plugins/docker
68     settings:
69       dockerfile: docker/prod/Dockerfile
70       #username: kevinbacon
71       #password: pa55word
72       repo: dessalines/lemmy
73     when:
74       ref:
75       - refs/tags/*
76
77 # TODO: also need to add more databases for federation test
78 #       (or use multiple DBs in the same postgres instance)
79 services:
80   - name: database
81     image: postgres:12-alpine
82     environment:
83       POSTGRES_USER: lemmy
84       POSTGRES_PASSWORD: password
85     detach: true
86
87 volumes:
88   - name: dieselcli
89     temp: {}