From 29ae11ed46ef0d76ac4f9029e7881dffe324911d Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Fri, 23 Sep 2022 09:46:24 +0800 Subject: [PATCH] README.md: Add step needed for DeepSource SaaS --- README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index aba1773..79bd0b3 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ jobs: 6. After the successful execution, `actions-rs@grcov` will set an Action output called `report` - with an absolute path to the coverage report file. + with an absolute path to the coverage report file under `/tmp`. This file can be uploaded to any code coverage service, ex. with [codecov](https://github.com/marketplace/actions/codecov) or [coveralls](https://github.com/marketplace/actions/coveralls-github-action) Actions help: @@ -99,6 +99,32 @@ jobs: path-to-lcov: ${{ steps.coverage.outputs.report }} ``` + If the upload action uses a docker image, ex. [deepsource](https://github.com/deepsourcelabs/test-coverage-action) + the report in `/tmp` wont be mapped into the action, so an extra + step is needed. + + + ```yaml + - name: Move coverage file into workspace + run: mv ${{ steps.coverage.outputs.report }} ./coverage.xml + + - name: Upload test coverage to DeepSource + uses: deepsourcelabs/test-coverage-action@master + with: + key: rust + coverage-file: coverage.xml + dsn: ${{ secrets.DEEPSOURCE_DSN }} + fail-ci-on-error: true + ``` + + Note: DeepSource GitHub action depends on the checkout action, usually at the start + of the job, uses the `HEAD` sha instead of the default "merge" sha: + ```yaml + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + ``` + ## Inputs * `config`: Configuration file path (relative to repository root, default to `.github/actions-rs/grcov.yml`)