forked from ibi-group/datatools-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
56 lines (54 loc) · 2.26 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
# although this is a node.js project, specify the use of Java in order for OTP
# and datatools-server to run as expected on Java 8 specifically. Although not
# confirmed in any way, another thought with using a Java-specific image is that
# some things may be more optimized for Java thus making for more expedient and
# reliable execution of Java code.
dist: trusty # jdk 8 not available on xenial
language: java
java:
- oraclejdk8
install: true
notifications:
email: false
services:
# needed for e2e tests to start datatools-server
- mongodb
- postgresql
addons:
postgresql: 9.6
cache:
directories:
- $HOME/.cache/yarn
- $HOME/.cache/pip
before_install:
# install node 12
- nvm install 12
# install yarn
- curl -o- -L https://yarnpkg.com/install.sh | bash
- pip install --user mkdocs
- source ./scripts/check-if-e2e-should-run-on-travis.sh
# create database for e2e tests
- if [ "$SHOULD_RUN_E2E" = "true" ]; then psql -U postgres -c 'CREATE DATABASE catalogue;'; fi
# add aws credentials for datatools-server
- if [ "$SHOULD_RUN_E2E" = "true" ]; then mkdir ~/.aws && printf '%s\n' '[default]' 'aws_access_key_id=${AWS_ACCESS_KEY_ID}' 'aws_secret_access_key=${AWS_SECRET_ACCESS_KEY}' 'region=us-east-1' > ~/.aws/config; else mkdir ~/.aws && printf '%s\n' '[default]' 'aws_access_key_id=foo' 'aws_secret_access_key=bar' 'region=us-east-1' > ~/.aws/config; fi
script:
- yarn
- yarn run lint
- yarn run lint-messages
- yarn run flow
- yarn run cover-client
# upload coverage results from unit tests and then delete coverage reports to
# avoid uploading the same coverage results twice
- bash <(curl -s https://codecov.io/bash) -c -F unit_tests
- if [ "$SHOULD_RUN_E2E" = "true" ]; then yarn run cover-end-to-end; fi
# upload coverage results from e2e tests and then delete coverage reports to
# avoid uploading the same coverage results twice
- if [ "$SHOULD_RUN_E2E" = "true" ]; then bash <(curl -s https://codecov.io/bash) -c -F end_to_end_tests; fi
- yarn run build -- --minify
- mkdocs build
# If sudo is disabled, CI runs on container based infrastructure (allows caching &c.)
sudo: false
# Push results to codecov.io
after_success:
# only deploy the release to github as the package is not needed on npm
- yarn run semantic-release