]> Untitled Git - lemmy.git/blob - .drone.yml
try running federation tests in same alpine version
[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: cargo check
13     image: ekidd/rust-musl-builder:1.47.0
14     commands:
15       - cargo check --all
16
17   - name: cargo clippy
18     image: ekidd/rust-musl-builder:1.47.0
19     commands:
20       - cargo clippy
21
22   - name: check documentation build
23     image: ekidd/rust-musl-builder:1.47.0
24     commands:
25       - mdbook build docs/
26
27   # this build somehow fails with the 1.47.0 image/without root
28   - name: install diesel cli
29     image: ekidd/rust-musl-builder:experimental-stable
30     user: root
31     volumes:
32       - name: dieselcli
33         path: /dieselcli
34     commands:
35       - cargo install diesel_cli --no-default-features --features postgres
36       - mv /root/.cargo/bin/diesel /dieselcli/diesel
37
38   - name: cargo test
39     image: ekidd/rust-musl-builder:1.47.0
40     environment:
41       LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
42       DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
43       RUST_BACKTRACE: 1
44       RUST_TEST_THREADS: 1
45     volumes:
46       - name: dieselcli
47         path: /dieselcli
48     commands:
49       - sudo apt-get update
50       - sudo apt-get -y install --no-install-recommends espeak postgresql-client
51       - /dieselcli/diesel migration run
52       - cargo test --workspace --no-fail-fast
53
54   - name: cargo build
55     image: ekidd/rust-musl-builder:1.47.0
56     volumes:
57       - name: dieselcli
58         path: /dieselcli
59     commands:
60       - cargo build
61
62   - name: run federation tests
63     image: node:15-alpine-3.12
64     commands:
65       - apt-get update
66       - apt-get -y install --no-install-recommends bash curl postgresql-client
67       - bash api_tests/prepare-drone-federation-test.sh
68       - cd api_tests/
69       - yarn
70       - yarn api-test
71
72   - name: create docker tags
73     image: ekidd/rust-musl-builder:1.47.0
74     commands:
75       - echo "$(git describe),latest" > .tags
76     when:
77       ref:
78       - refs/tags/*
79
80   - name: make release build and push to docker hub
81     image: plugins/docker
82     settings:
83       dockerfile: docker/prod/Dockerfile
84       #username: kevinbacon
85       #password: pa55word
86       repo: dessalines/lemmy
87     when:
88       ref:
89       - refs/tags/*
90
91 # TODO: also need to add more databases for federation test
92 #       (or use multiple DBs in the same postgres instance)
93 services:
94   - name: database
95     image: postgres:12-alpine
96     environment:
97       POSTGRES_USER: lemmy
98       POSTGRES_PASSWORD: password
99     detach: true
100
101 volumes:
102   - name: dieselcli
103     temp: {}