From 633331595bdc1e7c821063440fbead01aa3ee739 Mon Sep 17 00:00:00 2001 From: Valentin Kiselev Date: Mon, 22 May 2023 12:12:09 +0300 Subject: [PATCH] feat: add carryforward option to config (#74) --- doc/configuration.md | 3 +++ src/coverage_reporter/config.cr | 1 + src/coverage_reporter/reporter.cr | 2 +- src/coverage_reporter/yaml_config.cr | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/configuration.md b/doc/configuration.md index 123256aa..84880b20 100644 --- a/doc/configuration.md +++ b/doc/configuration.md @@ -65,4 +65,7 @@ service_name: my-ci # Coveralls endpoint endpoint: https://coveralls.io + +# Carryforward flags (or all to carry-forward all previous jobs) +carryforward: all ``` diff --git a/src/coverage_reporter/config.cr b/src/coverage_reporter/config.cr index 8070f544..86b3654e 100644 --- a/src/coverage_reporter/config.cr +++ b/src/coverage_reporter/config.cr @@ -59,6 +59,7 @@ module CoverageReporter delegate :[], to: to_h delegate :[]?, to: to_h + delegate :carryforward, to: @yaml def to_h @options ||= diff --git a/src/coverage_reporter/reporter.cr b/src/coverage_reporter/reporter.cr index 030dc317..bfdb479a 100644 --- a/src/coverage_reporter/reporter.cr +++ b/src/coverage_reporter/reporter.cr @@ -64,7 +64,7 @@ module CoverageReporter # from a CI-specific ENV, or can be set explicitly via `COVERALLS_SERVICE_NUMBER` # environment variable. def parallel_done - api = Api::Webhook.new(config, carryforward) + api = Api::Webhook.new(config, carryforward || config.carryforward) api.send_request(dry_run) end diff --git a/src/coverage_reporter/yaml_config.cr b/src/coverage_reporter/yaml_config.cr index 5da41cd1..031b106a 100644 --- a/src/coverage_reporter/yaml_config.cr +++ b/src/coverage_reporter/yaml_config.cr @@ -10,6 +10,7 @@ module CoverageReporter property repo_secret_token : String? property repo_name : String? property endpoint : String? + property carryforward : String? DEFAULT_LOCATION = ".coveralls.yml"