Skip to content

Commit a53705f

Browse files
committed
Add code coverage checking to the nightly run
This commit adds code coverage checking for the tests in the repo to the nightly Github Actions run. Signed-off-by: Ionut Mihalcea <ionut.mihalcea@arm.com>
1 parent 8c02c93 commit a53705f

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

.github/workflows/nightly.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name: Nightly Checks
33
on:
44
schedule:
55
# Every night at midnight
6-
- cron: '0 0 * * *'
6+
- cron: "0 0 * * *"
7+
workflow_dispatch:
78

89
jobs:
910
dependencies:
@@ -33,3 +34,11 @@ jobs:
3334
run: cargo install cargo-audit
3435
- name: Execute cargo audit
3536
run: cargo audit
37+
38+
coverage:
39+
name: Calculate coverage from tests
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v1
43+
- name: Execute tarpaulin
44+
run: ./tests/coverage.sh

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/target
22
*patch
33
Cargo.lock
4+
cobertura.xml

tests/coverage.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2021 Contributors to the Parsec project.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
set -euf -o pipefail
7+
8+
cargo install cargo-tarpaulin
9+
10+
cargo tarpaulin --tests --out Xml --exclude-files="src/core/testing/*"
11+
12+
bash <(curl -s https://codecov.io/bash)

0 commit comments

Comments
 (0)