]> Untitled Git - lemmy.git/blob - .drone.yml
try tests without diesel migration run
[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   - name: cargo test
28     image: ekidd/rust-musl-builder:1.47.0
29     environment:
30       LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
31       DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
32       RUST_BACKTRACE: 1
33       RUST_TEST_THREADS: 1
34     commands:
35       - sudo apt-get update
36       - sudo apt-get -y install --no-install-recommends espeak postgresql-client
37       - cargo test --workspace --no-fail-fast
38
39   - name: cargo build
40     image: ekidd/rust-musl-builder:1.47.0
41     commands:
42       - cargo build
43
44   - name: run federation tests
45     image: node:15-alpine-3.12
46     commands:
47       - apt-get update
48       - apt-get -y install --no-install-recommends bash curl postgresql-client
49       - bash api_tests/prepare-drone-federation-test.sh
50       - cd api_tests/
51       - yarn
52       - yarn api-test
53
54   - name: create docker tags
55     image: ekidd/rust-musl-builder:1.47.0
56     commands:
57       - echo "$(git describe),latest" > .tags
58     when:
59       ref:
60       - refs/tags/*
61
62   - name: make release build and push to docker hub
63     image: plugins/docker
64     settings:
65       dockerfile: docker/prod/Dockerfile
66       #username: kevinbacon
67       #password: pa55word
68       repo: dessalines/lemmy
69     when:
70       ref:
71       - refs/tags/*
72
73 # TODO: also need to add more databases for federation test
74 #       (or use multiple DBs in the same postgres instance)
75 services:
76   - name: database
77     image: postgres:12-alpine
78     environment:
79       POSTGRES_USER: lemmy
80       POSTGRES_PASSWORD: password
81     detach: true
82
83 volumes:
84   - name: dieselcli
85     temp: {}