Skip to content

Commit

Permalink
Fixing code coverage flow (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
Keboo authored Aug 14, 2023
1 parent 0ab52da commit 06a592e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 27 deletions.
28 changes: 2 additions & 26 deletions .github/workflows/code_coverage_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,8 @@ jobs:
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- name: Download artifact
uses: actions/github-script@v6
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "CodeCoverage"
})[0];
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/CodeCoverage.zip', Buffer.from(download.data));
- name: Unzip artifact
run: unzip CodeCoverage.zip
- name: Download artifacts
run: gh run download ${{ github.event.workflow_run.id }} -n CodeCoverage

- name: 'Get PR Number'
id: get-pr-number
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/main_pointerstar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
title: 'Code Coverage'

- name: Write PR Number
if: ${{ github.event_name == 'pull_request' }}
run: |
echo ${{ github.event.number }} > ./coveragereport/PullRequestNumber
Expand All @@ -54,9 +55,11 @@ jobs:
if-no-files-found: error

- name: dotnet publish
run: dotnet publish --configuration Release -p:Version="${{ env.version }}" -p:PublishDir=${{env.DOTNET_ROOT}}/publish
if: ${{ github.event_name != 'pull_request' }}
run: dotnet publish --configuration Release --no-build -p:Version="${{ env.version }}" -p:PublishDir=${{env.DOTNET_ROOT}}/publish

- name: Upload artifact for deployment job
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: app
Expand Down

0 comments on commit 06a592e

Please sign in to comment.