Skip to content

Commit b48e556

Browse files
committed
feat: add new options (#38)
- fail_on_error - measure - coverage_files
1 parent 635f170 commit b48e556

File tree

4 files changed

+40
-21
lines changed

4 files changed

+40
-21
lines changed

.circleci/config.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22
setup: true
33
orbs:
4-
orb-tools: circleci/orb-tools@11.5
4+
orb-tools: circleci/orb-tools@12.0.3
55
shellcheck: circleci/shellcheck@3.1
66

77
filters: &filters
@@ -19,20 +19,14 @@ workflows:
1919
filters: *filters
2020
- shellcheck/check:
2121
filters: *filters
22-
- orb-tools/publish:
23-
orb-name: coveralls/coveralls
24-
vcs-type: << pipeline.project.type >>
22+
# Triggers the next workflow in the Orb Development Kit.
23+
- orb-tools/continue:
24+
orb_name: coveralls
25+
pipeline_number: << pipeline.number >>
26+
vcs_type: << pipeline.project.type >>
2527
requires:
2628
- orb-tools/lint
2729
- orb-tools/pack
2830
- orb-tools/review
2931
- shellcheck/check
30-
# Use a context to hold your publishing token.
31-
context: publishing
32-
filters: *filters
33-
# Triggers the next workflow in the Orb Development Kit.
34-
- orb-tools/continue:
35-
pipeline-number: << pipeline.number >>
36-
vcs-type: << pipeline.project.type >>
37-
requires: [orb-tools/publish]
3832
filters: *filters

.circleci/test-deploy.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
---
22
version: 2.1
33
orbs:
4-
coveralls: coveralls/coveralls@dev:<<pipeline.git.revision>>
5-
orb-tools: circleci/orb-tools@11.5
6-
4+
orb-tools: circleci/orb-tools@12.0.3
75
filters: &filters
86
tags:
97
only: /.*/
10-
118
jobs:
129
command-tests:
1310
docker:
@@ -19,16 +16,16 @@ jobs:
1916
- coveralls/upload:
2017
dry_run: true
2118
verbose: true
19+
measure: true
2220
- coveralls/upload:
23-
dry_run: true
2421
verbose: true
2522
parallel: true
2623
coverage_file: test/main.c.gcov
24+
fail_on_error: false
2725
- coveralls/upload:
2826
dry_run: true
2927
verbose: true
3028
parallel_finished: true
31-
3229
workflows:
3330
test-deploy:
3431
jobs:
@@ -38,9 +35,9 @@ workflows:
3835
- orb-tools/pack:
3936
filters: *filters
4037
- orb-tools/publish:
41-
orb-name: coveralls/coveralls
42-
vcs-type: << pipeline.project.type >>
43-
pub-type: production
38+
orb_name: coveralls/coveralls
39+
vcs_type: << pipeline.project.type >>
40+
pub_type: production
4441
requires:
4542
- orb-tools/pack
4643
- command-tests

src/@orb.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ commands:
2222
This is the file that will be sent to the Coveralls API.
2323
type: string
2424
default: ''
25+
coverage_files:
26+
description: >
27+
Space-separated list of coverage reports to be uploaded.
28+
type: string
29+
default: ''
2530
coverage_format:
2631
description: >
2732
Force coverage report format. If not specified coveralls will try
@@ -94,6 +99,14 @@ commands:
9499
description: Commit SHA to compare coverage with.
95100
type: string
96101
default: ''
102+
measure:
103+
description: Enable time measurement logging
104+
type: boolean
105+
default: false
106+
fail_on_error:
107+
description: Whether to fail (exit code 1) on parsing or upload issues
108+
type: boolean
109+
default: true
97110
steps:
98111
- run:
99112
name: Upload Coverage Result To Coveralls
@@ -104,12 +117,15 @@ commands:
104117
COVERALLS_REPO_TOKEN_ENV: << parameters.token >>
105118
COVERALLS_VERBOSE: << parameters.verbose >>
106119
COVERALLS_COVERAGE_FILE: << parameters.coverage_file >>
120+
COVERALLS_COVERAGE_FILES: << parameters.coverage_files >>
107121
COVERALLS_CARRYFORWARD_FLAGS: << parameters.carryforward >>
108122
COVERALLS_FLAG_NAME: << parameters.flag_name >>
109123
COVERALLS_PARALLEL: << parameters.parallel >>
110124
COVERALLS_DRY_RUN: << parameters.dry_run >>
111125
COVERALLS_COMPARE_REF: << parameters.compare_ref >>
112126
COVERALLS_COMPARE_SHA: << parameters.compare_sha >>
113127
COVERALLS_COVERAGE_FORMAT: << parameters.coverage_format >>
128+
COVERALLS_MEASURE: << parameters.measure >>
129+
COVERALLS_FAIL_ON_ERROR: << parameters.fail_on_error >>
114130
COVERALLS_SOURCE_HEADER: circleci-orb
115131
command: <<include(scripts/coveralls.sh)>>

src/scripts/coveralls.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ if [ -z "${COVERALLS_REPO_TOKEN}" ]; then
2020
export COVERALLS_REPO_TOKEN=$(printenv "${COVERALLS_REPO_TOKEN_ENV}")
2121
fi
2222

23+
if [ "${COVERALLS_MEASURE}" == "1" ]; then
24+
args="${args} --measure"
25+
fi
26+
27+
if [ "${COVERALLS_FAIL_ON_ERROR}" != "1" ]; then
28+
args="${args} --no-fail"
29+
fi
30+
2331
if [ "${COVERALLS_DONE}" == "1" ]; then
2432
echo "Reporting parallel done"
2533

@@ -56,6 +64,10 @@ if [ -n "${COVERALLS_COVERAGE_FILE}" ]; then
5664
args="${args} ${coverage_file}"
5765
fi
5866

67+
if [ -n "${COVERALLS_COVERAGE_FILES}" ]; then
68+
args="${args} ${COVERALLS_COVERAGE_FILES}"
69+
fi
70+
5971
echo "Reporting coverage"
6072

6173
set -x

0 commit comments

Comments
 (0)