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 - name: Run tests
run: bundle exec rake spec run: bundle exec rake spec
env: env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
REDIS_URL: "redis://localhost:${{ job.services.redis.ports[6379] }}" 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 'poltergeist'
gem 'simplecov', require: false gem 'simplecov', require: false
gem 'simplecov-json', 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 'database_cleaner'
gem 'better_errors' gem 'better_errors'
gem 'letter_opener' # Use this just in local test environments gem 'letter_opener' # Use this just in local test environments

View File

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

View File

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