-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
44 lines (36 loc) · 1.09 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# image: "scorpil/rust:nightly"
image: rust:latest
services:
- postgres:latest
test:cargo_check:
script:
cargo check
cache:
paths:
- target/
- cargo/
test:cargo:
script:
- apt-get update -yqq
# Install programs that get called by rust
- apt-get install -y libimage-exiftool-perl
# Install diesel if a cached version is not present
- ls -l $CI_PROJECT_DIR/cargo/bin/diesel | grep diesel || cargo install diesel_cli
# Setup database
- DATABASE_URL=$DATABASE_TEST_URL $DIESEL_EXE database setup
- cargo build --color=always
- cargo test --color=always
cache:
paths:
- target/
- cargo/
variables:
CARGO_HOME: $CI_PROJECT_DIR/cargo
RUST_BACKTRACE: 1
TEST_FILE_STORAGE_PATH: /tmp/flash
DATABASE_TEST_URL: postgres://flash@postgres/flash_test
DATABASE_FOREIGN_URL: postgres://flash@postgres/flash_sync
POSTGRES_DB: flash_test
POSTGRES_USER: flash
POSTGRES_PASSWORD: ""
DIESEL_EXE: $CI_PROJECT_DIR/cargo/bin/diesel