Use codecov's bash-based github action

This commit is contained in:
Georg Gadinger 2020-05-01 10:13:42 +02:00
parent 1fe5e1de6f
commit 781a4ba8b4
4 changed files with 11 additions and 17 deletions

View File

@ -65,6 +65,9 @@ jobs:
- name: Run tests
run: bundle exec rake spec
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
REDIS_URL: "redis://localhost:${{ job.services.redis.ports[6379] }}"
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/coverage.xml

View File

@ -98,7 +98,7 @@ group :development, :test do
gem 'poltergeist'
gem 'simplecov', require: false
gem 'simplecov-json', require: false
gem 'codecov', require: false, git: "https://github.com/timoschilling/codecov-ruby", ref: "add-github-action-support" # watch this space: https://github.com/codecov/codecov-ruby/pull/52
gem 'simplecov-cobertura', require: false
gem 'database_cleaner'
gem 'better_errors'
gem 'letter_opener' # Use this just in local test environments

View File

@ -16,16 +16,6 @@ GIT
specs:
questiongenerator (0.1.0)
GIT
remote: https://github.com/timoschilling/codecov-ruby
revision: d98380b89acfe4c014aafc50c5ec0b075c32ef7a
ref: add-github-action-support
specs:
codecov (0.1.16)
json
simplecov
url
GEM
remote: https://rubygems.org/
remote: https://rails-assets.org/
@ -454,6 +444,8 @@ GEM
simplecov (0.18.5)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov-cobertura (1.3.1)
simplecov (~> 0.8)
simplecov-html (0.12.2)
simplecov-json (0.2.1)
json
@ -500,7 +492,6 @@ GEM
unicorn (5.5.4)
kgio (~> 2.6)
raindrops (~> 0.7)
url (0.3.2)
warden (1.2.8)
rack (>= 2.0.6)
web-console (3.7.0)
@ -527,7 +518,6 @@ DEPENDENCIES
brakeman
byebug
capybara
codecov!
coffee-rails (~> 4.1)
colorize
database_cleaner
@ -583,6 +573,7 @@ DEPENDENCIES
sass-rails (~> 5.0)
sidekiq (< 6)
simplecov
simplecov-cobertura
simplecov-json
spring (~> 2.0)
sweetalert-rails

View File

@ -3,7 +3,7 @@
require "simplecov"
SimpleCov.start "rails"
if ENV.key?("CODECOV_TOKEN")
require "codecov"
SimpleCov.formatter = SimpleCov::Formatter::Codecov
if ENV.key?("GITHUB_ACTIONS")
require "simplecov-cobertura"
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
end