Skip to content

Commit

Permalink
DEV: fix test and cov report
Browse files Browse the repository at this point in the history
  • Loading branch information
lbluque committed Sep 28, 2023
1 parent 2effcd0 commit 163809b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,29 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Download build artifact from triggered workflow
uses: dawidd6/action-download-artifact@v2
- name: download coverage artifact
uses: actions/github-script@v6
with:
run_id: ${{ github.event.workflow_run.id }}
name: coverage-report
search_artifacts: true
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "coverage"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/coverage.zip`, Buffer.from(download.data));
- name: unzip artifact
run: unzip coverage.zip

- name: run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ jobs:
name: upload coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-report
name: coverage
path: coverage.xml

0 comments on commit 163809b

Please sign in to comment.