]> Untitled Git - lemmy.git/blob - .drone.yml
Trying to fix arm build.
[lemmy.git] / .drone.yml
1 ---
2 kind: pipeline
3 name: amd64
4
5 platform:
6   os: linux
7   arch: amd64
8
9 steps:
10   - name: fetch git submodules
11     image: node:15-alpine3.12
12     commands:
13       - apk add git
14       - git submodule update --init --recursive --remote
15
16   - name: chown repo
17     image: ekidd/rust-musl-builder:1.47.0
18     user: root
19     commands:
20       - chown 1000:1000 . -R
21
22   - name: check documentation build
23     image: ekidd/rust-musl-builder:1.47.0
24     commands:
25       - cargo install mdbook --git https://github.com/Ruin0x11/mdBook.git --branch localization --rev d06249b
26       - mdbook build docs/
27
28   - name: check formatting
29     image: rustdocker/rust:nightly
30     commands:
31       - /root/.cargo/bin/cargo fmt -- --check
32
33   - name: cargo clippy
34     image: ekidd/rust-musl-builder:1.47.0
35     commands:
36       - cargo clippy --workspace --tests --all-targets --all-features -- -D warnings -D deprecated -D clippy::perf -D clippy::complexity -D clippy::dbg_macro
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       RUST_BACKTRACE: 1
43       RUST_TEST_THREADS: 1
44     commands:
45       - sudo apt-get update
46       - sudo apt-get -y install --no-install-recommends espeak postgresql-client
47       - cargo test --workspace --no-fail-fast
48
49   - name: cargo build
50     image: ekidd/rust-musl-builder:1.47.0
51     commands:
52       - cargo build
53       - mv target/x86_64-unknown-linux-musl/debug/lemmy_server target/lemmy_server
54
55   - name: run federation tests
56     image: node:15-alpine3.12
57     environment:
58       LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
59       DO_WRITE_HOSTS_FILE: 1
60     commands:
61       - apk add bash curl postgresql-client
62       - bash api_tests/prepare-drone-federation-test.sh
63       - cd api_tests/
64       - yarn
65       - yarn api-test
66
67   - name: make release build and push to docker hub
68     image: plugins/docker
69     settings:
70       dockerfile: docker/prod/Dockerfile
71       username:
72         from_secret: docker_username
73       password:
74         from_secret: docker_password
75       repo: dessalines/lemmy
76       auto_tag: true
77     when:
78       ref:
79       - refs/tags/*
80
81 services:
82   - name: database
83     image: postgres:12-alpine
84     environment:
85       POSTGRES_USER: lemmy
86       POSTGRES_PASSWORD: password
87
88 ---
89 kind: pipeline
90 name: arm64
91
92 platform:
93   os: linux
94   arch: arm64
95
96 steps:
97
98   - name: fetch git submodules
99     image: node:15-alpine3.12
100     commands:
101       - apk add git
102       - git submodule update --init --recursive --remote
103
104   - name: cargo test
105     image: rust:1.47-slim-buster
106     environment:
107       LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
108       RUST_BACKTRACE: 1
109       RUST_TEST_THREADS: 1
110     commands:
111       - apt-get update
112       - apt-get -y install --no-install-recommends espeak postgresql-client libssl-dev pkg-config libpq-dev
113       - cargo test --workspace --no-fail-fast
114       - cargo build
115
116   # Using Debian here because there seems to be no official Alpine-based Rust docker image for ARM.
117   - name: cargo build
118     image: rust:1.47-slim-buster
119     commands:
120       - apt-get update
121       - apt-get -y install --no-install-recommends libssl-dev pkg-config libpq-dev
122       - cargo build
123       - mv target/debug/lemmy_server target/lemmy_server
124
125   - name: run federation tests
126     image: node:15-buster-slim
127     environment:
128       LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
129       DO_WRITE_HOSTS_FILE: 1
130     commands:
131       - mkdir -p /usr/share/man/man1 /usr/share/man/man7
132       - apt-get update
133       - apt-get -y install --no-install-recommends bash curl libssl-dev pkg-config libpq-dev postgresql-client libc6-dev
134       - bash api_tests/prepare-drone-federation-test.sh
135       - cd api_tests/
136       - yarn
137       - yarn api-test
138
139   - name: make release build and push to docker hub
140     image: plugins/docker
141     settings:
142       dockerfile: docker/prod/Dockerfile.arm
143       username:
144         from_secret: docker_username
145       password:
146         from_secret: docker_password
147       repo: dessalines/lemmy
148       auto_tag: true
149       auto_tag_suffix: arm64
150     when:
151       ref:
152         - refs/tags/*
153
154 services:
155   - name: database
156     image: postgres:12-alpine
157     environment:
158       POSTGRES_USER: lemmy
159       POSTGRES_PASSWORD: password