Run test coverage just on the master branch

Since we changed the way we integrate coveralls in commit 8ed8cc8b9,
we're getting 6 additional checks displayed in our pull requests.

We don't need these checks, and they only add noise. The only reason we
use coveralls is to know the test coverage in our master branch.

So we're changing the code so coveralls only runs on the master branch.

There's also a chance that the test suite will be faster because it
doesn't need to keep track of the coverage, although I haven't noticed any
significant differences during my tests.

I haven't found a more elegant way to say that a certain step should
only be run on push on master, so I'm setting the environment variable
we were already using.
This commit is contained in:
Javi Martín
2022-12-04 15:50:53 +01:00
parent 462792d018
commit c614b0bc97
2 changed files with 6 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
ENV["RAILS_ENV"] ||= "test"
if ENV["TEST_COVERAGE"]
if ENV["TEST_COVERAGE"] && !ENV["TEST_COVERAGE"].empty?
require "simplecov"
require "simplecov-lcov"
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true