Skip to content

Commit 196be96

Browse files
Add codecoverage
1 parent 2deed06 commit 196be96

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

.github/codecov.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
comment: false
2+
coverage:
3+
status:
4+
project:
5+
default:
6+
target: auto
7+
# this allows a 10% drop from the previous base commit coverage
8+
threshold: 10%
9+
10+
github_checks:
11+
annotations: false

.github/workflows/CodeCov.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CodeCov
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- trying
8+
- staging
9+
tags: '*'
10+
pull_request:
11+
12+
jobs:
13+
codecov:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/[email protected]
18+
19+
- name: Set up Julia
20+
uses: julia-actions/setup-julia@latest
21+
with:
22+
version: 1.8
23+
24+
- name: Test with coverage
25+
env:
26+
JULIA_PROJECT: "@."
27+
run: |
28+
julia --project=@. -e 'using Pkg; Pkg.instantiate()'
29+
julia --project=@. -e 'using Pkg; Pkg.test(coverage=true)'
30+
31+
- name: Generate coverage file
32+
env:
33+
JULIA_PROJECT: "@."
34+
run: julia --project=@. -e 'using Pkg; Pkg.add("Coverage");
35+
using Coverage;
36+
LCOV.writefile("coverage-lcov.info", Codecov.process_folder())'
37+
if: success()
38+
39+
- name: Submit coverage
40+
uses: codecov/[email protected]
41+
with:
42+
token: ${{secrets.CODECOV_TOKEN}}
43+
if: success()

0 commit comments

Comments
 (0)