From 8d3829807a553b43a771c95a0f97f2767edc2217 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 3 Sep 2023 14:14:07 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20Fix=20test=20coverage=20actions?= =?UTF-8?q?=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deepsource-tests.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deepsource-tests.yml b/.github/workflows/deepsource-tests.yml index 0f5dde0..39c86a0 100644 --- a/.github/workflows/deepsource-tests.yml +++ b/.github/workflows/deepsource-tests.yml @@ -35,6 +35,8 @@ jobs: uses: actions/setup-node@v3 - name: Checkout uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -47,13 +49,13 @@ jobs: ${{ runner.os }}-yarn- - run: yarn install --immutable - run: yarn test:cov - - run: curl https://deepsource.io/cli | sh - - name: Report test-coverage to DeepSource + - name: Add git safe.directory for container run: | - # Install the CLI - curl https://deepsource.io/cli | sh - - # Send the report to DeepSource - ./bin/deepsource report --analyzer test-coverage --key javascript --value-file ./coverage/lcov.info - env: - DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }} \ No newline at end of file + mkdir -p /home/runner/work/_temp/_github_home + printf "[safe]\ndirectory = /github/workspace" > /home/runner/work/_temp/_github_home/.gitconfig + - name: Report test-coverage to DeepSource + uses: deepsourcelabs/test-coverage-action@master + with: + key: javascript + coverage-file: ./coverage/lcov.info + dsn: ${{ secrets.DEEPSOURCE_DSN }} \ No newline at end of file