From dcffcc0121606b68a1dd88e799b0e5acba223d26 Mon Sep 17 00:00:00 2001 From: Kent Tristan Yves Sarmiento Date: Sun, 24 Dec 2023 12:11:47 +0000 Subject: [PATCH] ci: upload coverage report to Deepsource --- .deepsource.toml | 7 ++++++- .github/workflows/development.yml | 13 ++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.deepsource.toml b/.deepsource.toml index 6d04d13..f132d1e 100644 --- a/.deepsource.toml +++ b/.deepsource.toml @@ -2,6 +2,11 @@ version = 1 [[analyzers]] name = "rust" +enabled = true [analyzers.meta] - msrv = "stable" \ No newline at end of file + msrv = "stable" + +[[analyzers]] +name = "test-coverage" +enabled = true diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index bba2e3f..abb4458 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -91,7 +91,11 @@ jobs: needs: test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + # https://docs.deepsource.com/docs/analyzers-test-coverage#with-github-actions + - name: Use pull request HEAD commit for DeepSource + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Install Rust uses: actions-rs/toolchain@v1 @@ -125,3 +129,10 @@ jobs: file: ./lcov.info env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + - name: Upload coverage reports to DeepSource + run: | + curl https://deepsource.io/cli | sh + ./bin/deepsource report --analyzer test-coverage --key rust --value-file ./lcov.info + env: + DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}