]> Untitled Git - lemmy.git/blob - .drone.yml
another try
[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/rustfmt:nightly
14     commands:
15       - /root/.cargo/bin/rustfmt --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       - apt-get update
53       - apt-get -y install --no-install-recommends bash curl postgresql-client
54       - bash api_tests/prepare-drone-federation-test.sh
55       - cd api_tests/
56       - yarn
57       - yarn api-test
58
59   - name: create docker tags
60     image: ekidd/rust-musl-builder:1.47.0
61     commands:
62       - echo "$(git describe),latest" > .tags
63     when:
64       ref:
65       - refs/tags/*
66
67   - name: make release build and push to docker hub
68     image: plugins/docker
69     settings:
70       dockerfile: docker/prod/Dockerfile
71       #username: kevinbacon
72       #password: pa55word
73       repo: dessalines/lemmy
74     when:
75       ref:
76       - refs/tags/*
77
78 # TODO: also need to add more databases for federation test
79 #       (or use multiple DBs in the same postgres instance)
80 services:
81   - name: database
82     image: postgres:12-alpine
83     environment:
84       POSTGRES_USER: lemmy
85       POSTGRES_PASSWORD: password
86     detach: true
87
88 volumes:
89   - name: dieselcli
90     temp: {}