Skip to content

Commit

Permalink
infra: try sha for coverage (#1018)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 authored Mar 7, 2024
1 parent 01f7fb9 commit 5b2ca50
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/coverage-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,21 @@ on:
jobs:
report:
runs-on: ubuntu-latest
strategy:
matrix:
branch:
- ${{ github.head_ref }}
- 'main'

permissions:
# Required to put a comment into the pull-request
pull-requests: write

steps:
- name: Slugify variables
uses: rlespinasse/slugify-value@a4879db1eb3db9bbee01dca36f98a8236c2b8239 # v1.4.0
with:
key: BRANCH
value: ${{ matrix.branch }}

- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Download Artifacts
if: ${{ env.BRANCH_SLUG != 'main' }}
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
name: coverage-${{ env.BRANCH_SLUG }}
name: coverage-${{ github.sha }}
path: coverage

- name: Download main Artifacts
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ jobs:
contents: read

steps:
- name: Slugify variables
uses: rlespinasse/slugify-value@a4879db1eb3db9bbee01dca36f98a8236c2b8239 # v1.4.0
with:
key: BRANCH
value: ${{ matrix.branch }}

- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
Expand All @@ -47,7 +41,16 @@ jobs:
run: pnpm run test:coverage

- name: Upload Coverage
if: ${{ matrix.branch != 'main' }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: coverage-${{ github.sha }}
path: coverage
retention-days: 15

- name: Upload Coverage
if: ${{ matrix.branch == 'main' }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: coverage-${{ env.BRANCH_SLUG }}
name: coverage-main
path: coverage

0 comments on commit 5b2ca50

Please sign in to comment.