Skip to content

Commit 71a4294

Browse files
committed
ci: attempt to fix coverage
1 parent d41009f commit 71a4294

3 files changed

Lines changed: 33 additions & 3 deletions

File tree

.github/codecov.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# See https://docs.codecov.com/docs/commit-status
2+
coverage:
3+
status:
4+
# The whole project must reach a coverage of 80% for the `codecov/project`
5+
# check to succeed.
6+
project:
7+
default:
8+
target: 80%
9+
threshold: 5% # How much the coverage can decrease.
10+
paths:
11+
- "!.github/"
12+
13+
# The patch itself (i.e. the modified lines) must be 80% covered by tests
14+
# for the `codecov/patch` check to succeed.
15+
patch:
16+
default:
17+
target: 80%
18+
threshold: 5%
19+
paths:
20+
- "!.github/"
21+
informational: true

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,15 @@ jobs:
8686

8787
- name: Generate coverage report
8888
if: ${{ matrix.coverage }}
89-
run: rebar3 cover --verbose
89+
run: rebar3 as test covertool generate
9090

9191
- name: Upload coverage to Codecov
9292
if: ${{ matrix.coverage }}
9393
uses: codecov/codecov-action@v4
9494
with:
95-
files: _build/test/cover/eunit.coverdata,_build/test/cover/ct.coverdata,_build/test/cover/proper.coverdata
95+
files: _build/test/covertool/gen_http.covertool.xml
9696
fail_ci_if_error: false
97+
flags: erlang-${{ matrix.otp }},os-${{ matrix.os }}
98+
name: Erlang/OTP ${{ matrix.otp }} on ${{ matrix.os }}
99+
verbose: true # optional (default = false)
97100
token: ${{ secrets.CODECOV_TOKEN }}

rebar.config

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
]}.
1515

1616
{project_plugins, [
17+
covertool,
1718
{rebar3_lint, "~> 4.2"},
1819
{erlfmt, "~> 1.7"},
1920
{rebar3_proper, "~> 0.12"}
@@ -93,10 +94,15 @@
9394

9495
{cover_enabled, true}.
9596
{cover_opts, [verbose]}.
97+
{cover_print_enabled, true}.
98+
{cover_export_enabled, true}.
99+
{covertool, [{coverdata_files, ["eunit.coverdata",
100+
"proper.coverdata",
101+
"ct.coverdata"]}]}.
96102

97103
{alias, [
98104
{test, [
99-
eunit, ct, proper, {cover, "-v"}
105+
eunit, ct, proper, {cover, "-v --min_coverage=75"}
100106
]}
101107
]}.
102108

0 commit comments

Comments
 (0)