-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
98 lines (89 loc) · 3.38 KB
/
.travis.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
language: rust
dist: focal
rust:
- stable
- beta
- nightly
addons:
chrome: stable
postgresql: '12'
apt:
packages:
- postgresql-12
env:
global:
- DATABASE_URL=postgres://postgres@localhost/firetrack
- PGUSER=postgres
- PGPORT=5432
- PGHOST=localhost
- SECRET_KEY=travis123
- SESSION_KEY=0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1
# Todo: enable sccache again when it supports clippy.
# https://github.com/mozilla/sccache/issues/423
# - RUSTC_WRAPPER=sccache
# - SCCACHE_VERSION=0.2.13
matrix:
allow_failures:
- rust: nightly
cache:
- cargo
- directories:
- $HOME/.cache/composer/files
before_install:
- sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/*/main/pg_hba.conf
- sudo systemctl start postgresql
- sudo journalctl | grep postgresql
# Travis CI uses the minimal profile for the Rust toolchain. Replace it with
# the default profile which includes clippy and rustfmt.
- rustup toolchain uninstall $TRAVIS_RUST_VERSION
- rustup toolchain install $TRAVIS_RUST_VERSION --profile=default
- sudo apt-get update
- sudo apt-get install php7.4 php7.4-xml php7.4-mbstring php7.4-curl
- php --version
# The version of Composer shipping with Xenial doesn't work with PHP 7.3.
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php composer-setup.php
- php composer.phar --version
# Install sccache by downloading the release binary. Building it would take
# more time than we gain by using it.
#- which sccache || travis_retry curl -Lo /tmp/sccache.tar.gz https://github.com/mozilla/sccache/releases/download/${SCCACHE_VERSION}/sccache-${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz
#- which sccache || tar -xzf /tmp/sccache.tar.gz --directory=/tmp/
#- which sccache || cp /tmp/sccache-${SCCACHE_VERSION}-x86_64-unknown-linux-musl/sccache ${TRAVIS_HOME}/.cargo/bin
# Install Diesel.
- cargo install diesel_cli --no-default-features --features "postgres" || true
- diesel --version
- diesel database setup --config-file=db/diesel.toml --migration-dir=db/migrations
install:
- php composer.phar install --no-interaction
- docker run -d -p 4444:4444 --network=host selenium/standalone-chrome:3.141.59-20210929
script:
# Check coding standards.
- cargo fmt --version
- cargo fmt --all -- --check
# Run clippy.
- cargo clippy --version
- cargo clippy --all-targets --all-features -- -D warnings
# Run Rust test suites.
- cargo test --all
# Build the project.
- cargo build
# Start the Mailgun mock server and wait for it to come online.
- cargo run -- mailgun-mock-server &> mailgun.log &
- until curl -s localhost:8089; do true; done &> /dev/null
# Start the webserver and wait for it to come online.
- MAILGUN_API_ENDPOINT=http://localhost:8089 cargo run -- serve &> actix.log &
- until curl -s localhost:8088; do true; done &> /dev/null
# Run BDD test suite.
- ./vendor/bin/behat --no-interaction
# Show server logs.
- cat actix.log
- cat mailgun.log
# Show how much data is cached.
- du -hd1 /home/travis/.cargo
- du -hs /home/travis/build/pfrenssen/firetrack/target
- du -hs /home/travis/.rustup
#- du -hs /home/travis/.cache/sccache
- du -hs $HOME/.cache/composer/files
before_cache:
- rm -rf /home/travis/.cargo/registry/src
- rm -rf /home/travis/build/pfrenssen/firetrack/target/*