summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authora14m <[email protected]>2020-12-14 20:07:09 +0100
committera14m <[email protected]>2020-12-14 23:02:24 +0100
commitb710263617e019e4ffed3dbafcc6795f760bb151 (patch)
tree0eef3a3f5618a0e7e71164e74db1e49d187fdd92
parente674394831d64aa5f64b9ca2b6a67ca16704e358 (diff)
Add codecov configurations for monorepo
-rw-r--r--.codecov.yml24
-rw-r--r--.gitlab-ci.yml6
-rw-r--r--CLI/ruby/.gitlab-ci.yml7
-rw-r--r--CLI/ruby/CHANGELOG.md1
-rw-r--r--CLI/ruby/spec/spec_helper.rb5
-rw-r--r--README.md1
6 files changed, 34 insertions, 10 deletions
diff --git a/.codecov.yml b/.codecov.yml
new file mode 100644
index 0000000..0854495
--- /dev/null
+++ b/.codecov.yml
@@ -0,0 +1,24 @@
+codecov:
+ require_ci_to_pass: yes
+
+coverage:
+ status:
+ project:
+ only_pulls: false
+ default:
+ target: 90%
+ ruby:
+ target: 95%
+ flags:
+ - ruby
+
+comment:
+ layout: "reach,diff,flags,files,footer"
+ behavior: default
+ require_changes: no
+
+flags:
+ ruby:
+ paths:
+ - CLI/ruby/
+ carryforward: true
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4926962..28e0986 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,6 +6,6 @@ ruby:
trigger:
include: CLI/ruby/.gitlab-ci.yml
strategy: depend
- only:
- changes:
- - CLI/ruby/*
+ rules:
+ - changes:
+ - CLI/ruby/**/*
diff --git a/CLI/ruby/.gitlab-ci.yml b/CLI/ruby/.gitlab-ci.yml
index d573ce5..6fdf07e 100644
--- a/CLI/ruby/.gitlab-ci.yml
+++ b/CLI/ruby/.gitlab-ci.yml
@@ -1,9 +1,4 @@
image: ruby:2.7
-stages:
- - build
- - test
- - lint
- - release
variables:
BUNDLE_PATH: .bundle/vendor
@@ -58,7 +53,7 @@ lint:
- bundle exec rubocop
release:
- stage: release
+ stage: deploy
needs: ["test:2.7", "test:2.6", "test:2.5", lint]
rules:
- if: $CI_COMMIT_TAG =~ /^ruby\/v.*$/
diff --git a/CLI/ruby/CHANGELOG.md b/CLI/ruby/CHANGELOG.md
index 48aad2a..3f6f77d 100644
--- a/CLI/ruby/CHANGELOG.md
+++ b/CLI/ruby/CHANGELOG.md
@@ -6,6 +6,7 @@
- Fix `game-of-life --delay -10` error with kernel sleep
- Fix `game-of-life --width -10` error with generated universe width
- Fix `game-of-life --height -10` error with generated universe height
+- Add coverage report
## 1.0.0
- Add ruby testing matrix for versions 2.5, 2.6 and 2.7
diff --git a/CLI/ruby/spec/spec_helper.rb b/CLI/ruby/spec/spec_helper.rb
index 0c453de..e7feb44 100644
--- a/CLI/ruby/spec/spec_helper.rb
+++ b/CLI/ruby/spec/spec_helper.rb
@@ -1,7 +1,10 @@
# frozen_string_literal: true
require "simplecov"
-SimpleCov.start
+SimpleCov.start do
+ add_filter "/spec/"
+ enable_coverage :branch
+end
require "codecov"
SimpleCov.formatter = SimpleCov::Formatter::Codecov if ENV["CODECOV_TOKEN"]
diff --git a/README.md b/README.md
index caa030b..e456aaf 100644
--- a/README.md
+++ b/README.md
@@ -5,5 +5,6 @@ in the following languages
[![pipeline status](https://gitlab.com/a14m/game-of-life/badges/master/pipeline.svg)](https://gitlab.com/a14m/game-of-life/-/commits/master)
[![license](https://img.shields.io/badge/license-MIT-brightgreenA)](https://gitlab.com/a14m/game-of-life/-/blob/master/LICENSE.md)
+[![codecov](https://codecov.io/gl/a14m/game-of-life/branch/master/graph/badge.svg?token=8KQ6LN5E6Z)](https://codecov.io/gl/a14m/game-of-life)
- [Ruby](./CLI/ruby) [![Gem Version](https://badge.fury.io/rb/terminal_game_of_life.svg)](https://badge.fury.io/rb/terminal_game_of_life)