diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0e6921c..a86de7e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,7 +3,8 @@ name: Nightly Checks on: schedule: # Every night at midnight - - cron: '0 0 * * *' + - cron: "0 0 * * *" + workflow_dispatch: jobs: dependencies: @@ -33,3 +34,11 @@ jobs: run: cargo install cargo-audit - name: Execute cargo audit run: cargo audit + + coverage: + name: Calculate coverage from tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Execute tarpaulin + run: ./tests/coverage.sh diff --git a/.gitignore b/.gitignore index f2482d7..37d53ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target *patch Cargo.lock +cobertura.xml diff --git a/tests/coverage.sh b/tests/coverage.sh new file mode 100755 index 0000000..1cf6872 --- /dev/null +++ b/tests/coverage.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# Copyright 2021 Contributors to the Parsec project. +# SPDX-License-Identifier: Apache-2.0 + +set -euf -o pipefail + +cargo install cargo-tarpaulin + +cargo tarpaulin --tests --out Xml --exclude-files="src/core/testing/*" + +bash <(curl -s https://codecov.io/bash)