Skip to content

Commit

Permalink
chore: upgrade codecov github workflow (#1768)
Browse files Browse the repository at this point in the history
Signed-off-by: Miles Zhang <[email protected]>
  • Loading branch information
zmcNotafraid authored Apr 10, 2024
1 parent 6e1b5fa commit a362c6d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- 5432:5432
redis:
image: redis
ports: ['6379:6379']
ports: ["6379:6379"]
options: --entrypoint redis-server
steps:
- uses: actions/checkout@v3
Expand All @@ -32,3 +32,9 @@ jobs:
bundle exec rails db:setup RAILS_ENV=test
cp .env.test.local.travis .env.test.local
bundle exec rails test RAILS_ENV=test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: coverage/coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ group :development, :test do
end

group :test do
gem "codecov", require: false
gem "database_cleaner"
gem "database_cleaner-active_record"
gem "minitest-reporters"
gem "mocha"
gem "shoulda-context"
gem "shoulda-matchers"
gem "simplecov", require: false
gem "simplecov-cobertura"
gem "vcr"
gem "webmock"
end
Expand Down
7 changes: 4 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ GEM
msgpack (~> 1.2)
builder (3.2.4)
byebug (11.1.3)
codecov (0.6.0)
simplecov (>= 0.15, < 0.22)
coderay (1.1.3)
concurrent-ruby (1.2.2)
config (4.1.0)
Expand Down Expand Up @@ -455,6 +453,9 @@ GEM
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-cobertura (2.1.0)
rexml
simplecov (~> 0.19)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
siphash (0.0.1)
Expand Down Expand Up @@ -518,7 +519,6 @@ DEPENDENCIES
bitcoinrb
bootsnap
ckb-sdk-ruby!
codecov
config
dalli
database_cleaner
Expand Down Expand Up @@ -569,6 +569,7 @@ DEPENDENCIES
shoulda-matchers
sidekiq
simplecov
simplecov-cobertura
solargraph
spring
spring-watcher-listen
Expand Down
9 changes: 4 additions & 5 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
require "simplecov"
require "simplecov-cobertura"
if ENV["CI"]
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
end
SimpleCov.start "rails" do
add_filter "/app/channels/"
add_filter "/app/jobs/"
Expand Down Expand Up @@ -41,11 +45,6 @@
end
end

if ENV["CI"] == "true"
require "codecov"
SimpleCov.formatter = SimpleCov::Formatter::Codecov
end

def prepare_node_data(node_tip_block_number = 30)
Sidekiq::Testing.inline!
GenerateStatisticsDataWorker.any_instance.stubs(:perform).returns(true)
Expand Down

0 comments on commit a362c6d

Please sign in to comment.