Try an experimental .travis.yml which uploads coverage to CodeClimate

This commit is contained in:
CactusPuppy 2021-03-17 20:38:14 -07:00
parent c7482bef1b
commit 8342b4c283
No known key found for this signature in database
GPG key ID: 4B33B0A3E15E2C82

View file

@ -1,8 +1,9 @@
os: linux
dist: bionic
language: ruby language: ruby
cache: bundler cache: bundler
rvm: rvm:
- 2.6.6 - 2.6.6
dist: bionic
addons: addons:
apt: apt:
packages: packages:
@ -12,10 +13,6 @@ services:
branches: branches:
except: except:
- /^depfu/.*$/ - /^depfu/.*$/
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)
notifications: notifications:
email: email:
on_success: change on_success: change
@ -25,30 +22,87 @@ notifications:
- "chat.freenode.net#osem" - "chat.freenode.net#osem"
on_success: change on_success: change
on_failure: change on_failure: change
before_script: stages:
- RAILS_ENV=test bundle exec rake db:bootstrap --trace - test
- RAILS_ENV=test bundle exec bin/rails webdrivers:chromedriver:update - finalize
- bash <(curl -Ls https://coverage.codacy.com/get.sh) download
script:
- "bin/travis_script.sh $TEST_SUITE"
after_success:
- bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial -l Ruby -r coverage/coverage.xml
jobs:
fast_finish: false
include:
- stage: finalize
script: bash <(curl -Ls https://coverage.codacy.com/get.sh) final
env: env:
global: global:
- OSEM_DB_ADAPTER=sqlite3 - OSEM_DB_ADAPTER=sqlite3
- OSEM_DB_HOST='' - OSEM_DB_HOST=''
- OSEM_DB_PORT='' - OSEM_DB_PORT=''
- OSEM_DB_NAME='osem_test' - OSEM_DB_NAME='osem_test'
jobs: - CC_TEST_REPORTER_ID=$CC_TEST_REPORTER
- TEST_SUITE=ability - CCTR=./cc-test-reporter
- TEST_SUITE=features - TOTAL_TEST_SUITES=5
- TEST_SUITE=models jobs:
- TEST_SUITE=controllers - &tests
- TEST_SUITE=rest 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:
- "bin/travis_script.sh $TEST_SUITE"
after_success:
- $CCTR format-coverage -t simplecov -o ./coverage/codeclimate.1.json ./coverage/spec/.resultset.json
env:
- TEST_SUITE=ability
workspaces:
create:
name: ws1
paths:
- coverage/codeclimate.1.json
- <<: *tests
env:
- TEST_SUITE=features
after_success:
- $CCTR format-coverage -t simplecov -o ./coverage/codeclimate.2.json ./coverage/spec/.resultset.json
workspaces:
create:
name: ws2
paths:
- coverage/codeclimate.2.json
- <<: *tests
env:
- TEST_SUITE=models
after_success:
- $CCTR format-coverage -t simplecov -o ./coverage/codeclimate.3.json ./coverage/spec/.resultset.json
workspaces:
create:
name: ws3
paths:
- coverage/codeclimate.3.json
- <<: *tests
env:
- TEST_SUITE=controllers
after_success:
- $CCTR format-coverage -t simplecov -o ./coverage/codeclimate.4.json ./coverage/spec/.resultset.json
workspaces:
create:
name: ws4
paths:
- coverage/codeclimate.4.json
- <<: *tests
env:
- TEST_SUITE=features
after_success:
- $CCTR format-coverage -t simplecov -o ./coverage/codeclimate.5.json ./coverage/spec/.resultset.json
workspaces:
create:
name: ws5
paths:
- coverage/codeclimate.5.json
- stage: finalize
workspaces:
use:
- ws1
- ws2
- ws3
- ws4
- ws5
script: $CCTR sum-coverage --output - --parts $TOTAL_TEST_SUITES coverage/codeclimate.*.json | $CCTR upload-coverage --input -