Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
name: "Test"
name: Report Coverage

on:
pull_request:
workflow_run:
workflows: ["Test"]
types:
- completed

jobs:
test:
report:
runs-on: ubuntu-latest

permissions:
# Required to checkout the code
contents: read
# Required to put a comment into the pull-request
pull-requests: write

steps:
- uses: actions/checkout@v4
- name: "Install Node"
uses: actions/setup-node@v3
- uses: actions/download-artifact@v4
with:
node-version: "20.x"
- name: "Install Deps"
run: npm install
- name: "Test"
run: npx vitest --coverage
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: "Report Coverage"
if: always() # Also generate the report if tests are failing
uses: davelosert/vitest-coverage-report-action@v2

27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Test"
on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: "Install Node"
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: "Install Deps"
run: npm install
- name: "Test"
run: npx vitest --coverage.enabled true

- name: "Upload Coverage"
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
This file is Free Software under the MIT License
This file is free software under the MIT License
without warranty, see README.md and LICENSES/MIT.txt for details.

SPDX-License-Identifier: MIT
Expand Down
24 changes: 24 additions & 0 deletions coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Report Coverage

on:
workflow_run:
workflows: ["Test"]
types:
- completed

jobs:
report:
runs-on: ubuntu-latest

permissions:
pull-requests: write

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: "Report Coverage"
uses: davelosert/vitest-coverage-report-action@v2

27 changes: 27 additions & 0 deletions test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Test"
on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: "Install Node"
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: "Install Deps"
run: npm install
- name: "Test"
run: npx vitest --coverage.enabled true

- name: "Upload Coverage"
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage