diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 00000000..76265567 --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,43 @@ +name: coverage + +on: + pull_request: + branches: [ "*" ] + +jobs: + check: + name: Rust project + runs-on: ubuntu-latest + + defaults: + run: + working-directory: ./node + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Run cargo-tarpaulin + uses: actions-rs/tarpaulin@v0.1 + with: + version: '0.15.0' + args: '--manifest-path node/Cargo.toml -- --test-threads 1' + env: + RUST_LOG: 'network=trace,sync_blocks=trace,consensus=trace' + + - name: Upload to codecov.io + uses: codecov/codecov-action@v1.0.2 + with: + token: ${{secrets.CODECOV_TOKEN}} + + - name: Archive code coverage results + uses: actions/upload-artifact@v1 + with: + name: code-coverage-report + path: cobertura.xml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..7fe44e38 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,17 @@ +coverage: + range: "10...90" + status: + # We might gate PRs based on coverage diffs, + # but we don't want that for now + project: + default: + informational: true + patch: + default: + informational: true + +comment: + require_changes: true + +github_checks: + annotations: false \ No newline at end of file