Merge pull request #35 from CactusPuppy/fix-ci

Fix continuous integration pipeline
This commit is contained in:
CactusPuppy 2021-03-19 00:55:48 -07:00 committed by GitHub
commit 12f4b75e16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 96 additions and 44 deletions

View file

@ -1,23 +1,8 @@
language: ruby os: linux
cache: bundler
rvm:
- 2.6.6
dist: bionic dist: bionic
addons:
apt:
packages:
- chromium-browser
services:
- postgresql
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)
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > $CCTR
- chmod +x $CCTR
notifications: notifications:
email: email:
on_success: change on_success: change
@ -27,19 +12,9 @@ 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
- $CCTR before-build
script:
- "bin/travis_script.sh $TEST_SUITE"
# TODO Get this working.
after_script:
# combine coverage from all suites, and upload3 to CodeClimate
- $CCTR format-coverage -t simplecov --output coverage/codeclimate.$TEST_SUITE.json
- $CCTR sum-coverage coverage/codeclimate.*.json
- if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then $CCTR upload-coverage; fi
env: env:
global: global:
- OSEM_DB_ADAPTER=sqlite3 - OSEM_DB_ADAPTER=sqlite3
@ -48,11 +23,90 @@ env:
- OSEM_DB_NAME='osem_test' - OSEM_DB_NAME='osem_test'
- CC_TEST_REPORTER_ID=$CC_TEST_REPORTER - CC_TEST_REPORTER_ID=$CC_TEST_REPORTER
- CCTR=./cc-test-reporter - CCTR=./cc-test-reporter
matrix: - TOTAL_TEST_SUITES=5
- TEST_SUITE=ability jobs:
- TEST_SUITE=features include:
- TEST_SUITE=models - &tests
- TEST_SUITE=controllers language: ruby
- TEST_SUITE=rest cache: bundler
matrix: rvm:
fast_finish: false - 2.6.6
addons:
apt:
packages:
- chromium-browser
services:
- postgresql
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 && $CCTR format-coverage -t cobertura -o ./coverage/codeclimate.1.json ./coverage/coverage.xml"
env:
- TEST_SUITE=ability
workspaces:
create:
name: ws1
paths:
- coverage/codeclimate.1.json
- <<: *tests
env:
- TEST_SUITE=features
script:
- "bin/travis_script.sh $TEST_SUITE && $CCTR format-coverage -t cobertura -o ./coverage/codeclimate.2.json ./coverage/coverage.xml"
workspaces:
create:
name: ws2
paths:
- coverage/codeclimate.2.json
- <<: *tests
env:
- TEST_SUITE=models
script:
- "bin/travis_script.sh $TEST_SUITE && $CCTR format-coverage -t cobertura -o ./coverage/codeclimate.3.json ./coverage/coverage.xml"
workspaces:
create:
name: ws3
paths:
- coverage/codeclimate.3.json
- <<: *tests
env:
- TEST_SUITE=controllers
script:
- "bin/travis_script.sh $TEST_SUITE && $CCTR format-coverage -t cobertura -o ./coverage/codeclimate.4.json ./coverage/coverage.xml"
workspaces:
create:
name: ws4
paths:
- coverage/codeclimate.4.json
- <<: *tests
env:
- TEST_SUITE=rest
script:
- "bin/travis_script.sh $TEST_SUITE && $CCTR format-coverage -t cobertura -o ./coverage/codeclimate.5.json ./coverage/coverage.xml"
workspaces:
create:
name: ws5
paths:
- coverage/codeclimate.5.json
- stage: finalize
if: branch = master
language: minimal
before_install:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > $CCTR
- chmod +x $CCTR
workspaces:
use:
- ws1
- ws2
- ws3
- ws4
- ws5
script: $CCTR sum-coverage --output - --parts $TOTAL_TEST_SUITES coverage/codeclimate.*.json | $CCTR upload-coverage --input -

View file

@ -280,6 +280,9 @@ group :development, :test, :linters do
gem 'rubocop-rspec', require: false gem 'rubocop-rspec', require: false
gem 'haml-lint', require: false gem 'haml-lint', require: false
end
group :development, :test do
# as development/test database # as development/test database
gem 'sqlite3' gem 'sqlite3'
end end

View file

@ -1,7 +1,7 @@
### Spring 2021 Student Project ### Spring 2021 Student Project
[![Build Status](https://travis-ci.com/CactusPuppy/snapcon.svg?branch=master)](https://travis-ci.com/CactusPuppy/snapcon) [![Build Status](https://travis-ci.com/CactusPuppy/snapcon.svg?branch=master)](https://travis-ci.com/CactusPuppy/snapcon)
[![Maintainability](https://api.codeclimate.com/v1/badges/6c7fc446b3b10866ba71/maintainability)](https://codeclimate.com/github/CactusPuppy/snapcon/maintainability) [![Maintainability](https://api.codeclimate.com/v1/badges/6c7fc446b3b10866ba71/maintainability)](https://codeclimate.com/github/CactusPuppy/snapcon/maintainability)
[![codecov](https://codecov.io/gh/CactusPuppy/snapcon/branch/master/graph/badge.svg?token=y4aEAtw6KJ)](https://codecov.io/gh/CactusPuppy/snapcon) [![Test Coverage](https://api.codeclimate.com/v1/badges/6c7fc446b3b10866ba71/test_coverage)](https://codeclimate.com/github/CactusPuppy/snapcon/test_coverage)
[![Security Status](https://hakiri.io/github/CactusPuppy/snapcon/master.svg)](https://hakiri.io/github/CactusPuppy/snapcon/master) [![Security Status](https://hakiri.io/github/CactusPuppy/snapcon/master.svg)](https://hakiri.io/github/CactusPuppy/snapcon/master)
[![Depfu](https://badges.depfu.com/badges/16eb1ffb3a9f1a36c4e595a5ae2a1dca/overview.svg)](https://depfu.com/github/CactusPuppy/snapcon?project_id=22682) [![Depfu](https://badges.depfu.com/badges/16eb1ffb3a9f1a36c4e595a5ae2a1dca/overview.svg)](https://depfu.com/github/CactusPuppy/snapcon?project_id=22682)
[![Bluejay Dashboard](https://img.shields.io/badge/Bluejay-Dashboard_5-blue.svg)](http://dashboard.bluejay.governify.io/dashboard/script/dashboardLoader.js?dashboardURL=https://reporter.bluejay.governify.io/api/v4/dashboards/tpa-CS169L-GH-CactusPuppy_snapcon/main) [![Bluejay Dashboard](https://img.shields.io/badge/Bluejay-Dashboard_5-blue.svg)](http://dashboard.bluejay.governify.io/dashboard/script/dashboardLoader.js?dashboardURL=https://reporter.bluejay.governify.io/api/v4/dashboards/tpa-CS169L-GH-CactusPuppy_snapcon/main)

View file

@ -7,7 +7,6 @@
# id :bigint not null, primary key # id :bigint not null, primary key
# abstract :text # abstract :text
# comments_count :integer default(0), not null # comments_count :integer default(0), not null
# committee_review :text
# description :text # description :text
# guid :string not null # guid :string not null
# is_highlight :boolean default(FALSE) # is_highlight :boolean default(FALSE)

View file

@ -7,7 +7,6 @@
# id :bigint not null, primary key # id :bigint not null, primary key
# abstract :text # abstract :text
# comments_count :integer default(0), not null # comments_count :integer default(0), not null
# committee_review :text
# description :text # description :text
# guid :string not null # guid :string not null
# is_highlight :boolean default(FALSE) # is_highlight :boolean default(FALSE)

View file

@ -7,7 +7,6 @@
# id :bigint not null, primary key # id :bigint not null, primary key
# abstract :text # abstract :text
# comments_count :integer default(0), not null # comments_count :integer default(0), not null
# committee_review :text
# description :text # description :text
# guid :string not null # guid :string not null
# is_highlight :boolean default(FALSE) # is_highlight :boolean default(FALSE)

View file

@ -7,7 +7,6 @@
# id :bigint not null, primary key # id :bigint not null, primary key
# abstract :text # abstract :text
# comments_count :integer default(0), not null # comments_count :integer default(0), not null
# committee_review :text
# description :text # description :text
# guid :string not null # guid :string not null
# is_highlight :boolean default(FALSE) # is_highlight :boolean default(FALSE)

View file

@ -7,7 +7,6 @@
# id :bigint not null, primary key # id :bigint not null, primary key
# abstract :text # abstract :text
# comments_count :integer default(0), not null # comments_count :integer default(0), not null
# committee_review :text
# description :text # description :text
# guid :string not null # guid :string not null
# is_highlight :boolean default(FALSE) # is_highlight :boolean default(FALSE)

View file

@ -3,7 +3,7 @@
# This file is copied to spec/ when you run 'rails generate rspec:install' # This file is copied to spec/ when you run 'rails generate rspec:install'
require 'simplecov' require 'simplecov'
if ENV['GITHUB_ACTIONS'] if ENV['GITHUB_ACTIONS'] || ENV['TRAVIS']
require 'simplecov-cobertura' require 'simplecov-cobertura'
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
end end