-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
53 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,70 @@ | ||
sudo: required | ||
|
||
language: generic | ||
language: ruby | ||
|
||
rvm: | ||
- 2.4.4 | ||
|
||
services: | ||
- docker | ||
|
||
addons: | ||
mariadb: '10.2' | ||
|
||
cache: | ||
directories: | ||
- $PWD/vendor/.bundle/ | ||
|
||
git: | ||
depth: false | ||
|
||
env: | ||
global: | ||
- COMPOSE_FILE=./containers/docker-compose-testing.yml | ||
- CI=true | ||
matrix: | ||
- TASK="rake test:all" | ||
- TASK="rails test test/unit" | ||
- TASK="rails test test/functional" | ||
- TASK="rails test test/integration" | ||
- TASK="rails test:system" | ||
|
||
branches: | ||
only: | ||
- master | ||
- unstable | ||
- codecov | ||
- GENERATE_REPORT=true | ||
|
||
install: | ||
- rm -rf test/reports | ||
- cp config/database.yml.example config/database.yml | ||
- cp db/schema.rb.example db/schema.rb | ||
- docker-compose build | ||
- docker-compose up -d | ||
- docker-compose exec web sleep 15 # wait until mysql is up | ||
- netstat -ltpn | ||
- docker-compose exec web bash -c "rake db:setup" | ||
- docker-compose exec web bash -c "rake db:migrate" | ||
- docker-compose exec web bash -c "rake assets:precompile" | ||
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash -c "docker-compose exec web gem install danger danger-junit google-cloud-storage"; fi' | ||
|
||
script: | ||
- docker-compose exec web bash -c 'echo "$GOOGLE_APPLICATION_CREDENTIALS_JSON" > /tmp/credentials.json' # needs to be a path to a json file, so we shuffle... | ||
- docker-compose exec web bash -c "GENERATE_REPORT=true $TASK" | ||
- if [ $TASK != "rake test:all" ]; then | ||
echo -e '<?xml version="1.0" encoding="UTF-8"?>' > output.xml; | ||
tail -n +2 -q ./test/reports/TEST*.xml >> output.xml; | ||
- bundle install --path vendor/.bundle/ | ||
- if [ $RAILS_ENV != 'production' ]; then | ||
yarn check || yarn install; | ||
fi | ||
- if [ $TRAVIS_PULL_REQUEST != "false" ]; then | ||
docker-compose exec web danger --verbose; | ||
- bundle exec rails db:setup | ||
- bundle exec rails db:migrate | ||
- if [ "$TRAVIS_PULL_REQUEST" == "true" ]; then | ||
gem install danger danger-junit google-cloud-storage | ||
fi | ||
- echo "$GOOGLE_APPLICATION_CREDENTIALS_JSON" > /tmp/credentials.json # needs to be a path to a json file, so we shuffle... | ||
|
||
jobs: | ||
include: | ||
- name: "Unit Tests" | ||
script: bundle exec rails test test/unit | ||
- name: "Functional Tests" | ||
script: bundle exec rails test test/functional | ||
- name: "Integration Tests" | ||
script: bundle exec rails test test/integration | ||
- name: "System Tests" | ||
script: bundle exec rails test:system | ||
- name: "Docker Builds" | ||
script: docker build -t plots2 . | ||
- name: "Asset Precompilation" | ||
env: | ||
- RAILS_ENV=production | ||
script: | ||
- bundle exec rails assets:precompile | ||
|
||
after_script: | ||
- echo -e '<?xml version="1.0" encoding="UTF-8"?>' > output.xml; | ||
- tail -n +2 -q ./test/reports/TEST*.xml >> output.xml | ||
- if [ $TRAVIS_PULL_REQUEST == "true" ]; then | ||
danger --verbose; | ||
fi | ||
|
||
branches: | ||
only: | ||
- master | ||
- unstable | ||
- codecov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters