Skip to content

Commit

Permalink
Merge pull request #2 from test-prof/chore/coveralls
Browse files Browse the repository at this point in the history
Add coveralls
  • Loading branch information
palkan authored Nov 13, 2023
2 parents ec7ad70 + 6fbffab commit 0d744bf
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ jobs:
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
CI: true
COVERAGE: ${{ matrix.coverage }}
strategy:
fail-fast: false
matrix:
ruby: ["2.7", "3.0", "3.1"]
coverage: ["false"]
include:
- ruby: "3.2"
coverage: "true"
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
Expand All @@ -26,3 +31,9 @@ jobs:
- name: Run RSpec
run: |
bundle exec rspec
- name: Coveralls
if: ${{ matrix.coverage == 'true' }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
coveralls-endpoint: ${{ secrets.COVERALLS_ENDPOINT }}
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ local_gemfile = "#{File.dirname(__FILE__)}/Gemfile.local"
if File.exist?(local_gemfile)
eval(File.read(local_gemfile)) # rubocop:disable Security/Eval
end

if ENV["COVERAGE"] == "true"
gem "simplecov"
gem "simplecov-lcov"
end
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021 Vladimir Dementyev, Ruslan Shakirov
Copyright (c) 2021-2023 Vladimir Dementyev, Ruslan Shakirov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 12 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# frozen_string_literal: true

if ENV["COVERAGE"] == "true"
require "simplecov"
require "simplecov-lcov"
SimpleCov::Formatter::LcovFormatter.config do |c|
c.report_with_single_file = true
c.single_report_path = "coverage/lcov.info"
end

SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
SimpleCov.start
end

require "debug" unless ENV["CI"]

require "active_support"
Expand Down

0 comments on commit 0d744bf

Please sign in to comment.