2021-03-17 20:38:14 -07:00
|
|
|
os: linux
|
|
|
|
|
dist: bionic
|
2018-08-30 15:39:02 +02:00
|
|
|
branches:
|
2019-04-01 13:04:06 +02:00
|
|
|
except:
|
|
|
|
|
- /^depfu/.*$/
|
2014-04-09 17:04:03 +02:00
|
|
|
notifications:
|
|
|
|
|
email:
|
|
|
|
|
on_success: change
|
|
|
|
|
on_failure: change
|
2016-02-08 13:07:47 +01:00
|
|
|
irc:
|
|
|
|
|
channels:
|
|
|
|
|
- "chat.freenode.net#osem"
|
|
|
|
|
on_success: change
|
|
|
|
|
on_failure: change
|
2021-03-17 20:38:14 -07:00
|
|
|
stages:
|
|
|
|
|
- test
|
|
|
|
|
- finalize
|
2017-06-09 14:41:44 +02:00
|
|
|
env:
|
2018-05-08 08:45:31 -07:00
|
|
|
global:
|
2018-11-19 08:30:52 -08:00
|
|
|
- OSEM_DB_ADAPTER=sqlite3
|
2018-09-05 01:56:14 +02:00
|
|
|
- OSEM_DB_HOST=''
|
|
|
|
|
- OSEM_DB_PORT=''
|
|
|
|
|
- OSEM_DB_NAME='osem_test'
|
2021-03-17 20:38:14 -07:00
|
|
|
- CC_TEST_REPORTER_ID=$CC_TEST_REPORTER
|
|
|
|
|
- CCTR=./cc-test-reporter
|
|
|
|
|
- TOTAL_TEST_SUITES=5
|
|
|
|
|
jobs:
|
2021-03-17 20:41:13 -07:00
|
|
|
include:
|
|
|
|
|
- &tests
|
2021-03-18 17:16:28 -07:00
|
|
|
language: ruby
|
|
|
|
|
cache: bundler
|
|
|
|
|
rvm:
|
|
|
|
|
- 2.6.6
|
|
|
|
|
addons:
|
|
|
|
|
apt:
|
|
|
|
|
packages:
|
|
|
|
|
- chromium-browser
|
|
|
|
|
services:
|
|
|
|
|
- postgresql
|
2021-03-17 20:41:13 -07:00
|
|
|
before_install:
|
|
|
|
|
- "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
|
|
|
|
|
- gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
|
|
|
|
|
- gem install bundler -v $(tail -n 1 Gemfile.lock)
|
|
|
|
|
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > $CCTR
|
|
|
|
|
- chmod +x $CCTR
|
|
|
|
|
before_script:
|
|
|
|
|
- RAILS_ENV=test bundle exec rake db:bootstrap --trace
|
|
|
|
|
- RAILS_ENV=test bundle exec bin/rails webdrivers:chromedriver:update
|
|
|
|
|
- $CCTR before-build
|
|
|
|
|
script:
|
2021-03-18 16:32:45 -07:00
|
|
|
- "bin/travis_script.sh $TEST_SUITE && $CCTR format-coverage -t cobertura -o ./coverage/codeclimate.1.json ./coverage/coverage.xml"
|
2021-03-17 20:41:13 -07:00
|
|
|
env:
|
|
|
|
|
- TEST_SUITE=ability
|
|
|
|
|
workspaces:
|
|
|
|
|
create:
|
|
|
|
|
name: ws1
|
|
|
|
|
paths:
|
|
|
|
|
- coverage/codeclimate.1.json
|
|
|
|
|
- <<: *tests
|
|
|
|
|
env:
|
|
|
|
|
- TEST_SUITE=features
|
2021-03-18 16:10:24 -07:00
|
|
|
script:
|
2021-03-18 16:32:45 -07:00
|
|
|
- "bin/travis_script.sh $TEST_SUITE && $CCTR format-coverage -t cobertura -o ./coverage/codeclimate.2.json ./coverage/coverage.xml"
|
2021-03-17 20:41:13 -07:00
|
|
|
workspaces:
|
|
|
|
|
create:
|
|
|
|
|
name: ws2
|
|
|
|
|
paths:
|
|
|
|
|
- coverage/codeclimate.2.json
|
|
|
|
|
- <<: *tests
|
|
|
|
|
env:
|
|
|
|
|
- TEST_SUITE=models
|
2021-03-18 16:10:24 -07:00
|
|
|
script:
|
2021-03-18 16:32:45 -07:00
|
|
|
- "bin/travis_script.sh $TEST_SUITE && $CCTR format-coverage -t cobertura -o ./coverage/codeclimate.3.json ./coverage/coverage.xml"
|
2021-03-17 20:41:13 -07:00
|
|
|
workspaces:
|
|
|
|
|
create:
|
|
|
|
|
name: ws3
|
|
|
|
|
paths:
|
|
|
|
|
- coverage/codeclimate.3.json
|
|
|
|
|
- <<: *tests
|
|
|
|
|
env:
|
|
|
|
|
- TEST_SUITE=controllers
|
2021-03-18 16:10:24 -07:00
|
|
|
script:
|
2021-03-18 16:32:45 -07:00
|
|
|
- "bin/travis_script.sh $TEST_SUITE && $CCTR format-coverage -t cobertura -o ./coverage/codeclimate.4.json ./coverage/coverage.xml"
|
2021-03-17 20:41:13 -07:00
|
|
|
workspaces:
|
|
|
|
|
create:
|
|
|
|
|
name: ws4
|
|
|
|
|
paths:
|
|
|
|
|
- coverage/codeclimate.4.json
|
|
|
|
|
- <<: *tests
|
|
|
|
|
env:
|
2021-03-18 23:01:24 -07:00
|
|
|
- TEST_SUITE=rest
|
2021-03-18 16:10:24 -07:00
|
|
|
script:
|
2021-03-18 16:32:45 -07:00
|
|
|
- "bin/travis_script.sh $TEST_SUITE && $CCTR format-coverage -t cobertura -o ./coverage/codeclimate.5.json ./coverage/coverage.xml"
|
2021-03-17 20:41:13 -07:00
|
|
|
workspaces:
|
|
|
|
|
create:
|
|
|
|
|
name: ws5
|
|
|
|
|
paths:
|
|
|
|
|
- coverage/codeclimate.5.json
|
|
|
|
|
- stage: finalize
|
2021-03-18 23:48:06 -07:00
|
|
|
if: branch = master
|
2021-03-18 17:23:12 -07:00
|
|
|
language: minimal
|
2021-03-18 16:10:24 -07:00
|
|
|
before_install:
|
|
|
|
|
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > $CCTR
|
|
|
|
|
- chmod +x $CCTR
|
2021-03-17 20:41:13 -07:00
|
|
|
workspaces:
|
|
|
|
|
use:
|
|
|
|
|
- ws1
|
|
|
|
|
- ws2
|
|
|
|
|
- ws3
|
|
|
|
|
- ws4
|
|
|
|
|
- ws5
|
|
|
|
|
script: $CCTR sum-coverage --output - --parts $TOTAL_TEST_SUITES coverage/codeclimate.*.json | $CCTR upload-coverage --input -
|