-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
86 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Collect test coverage | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
get-coverage: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
branch: | ||
- ${{ github.head_ref }} | ||
- "main" | ||
|
||
permissions: | ||
# Required to checkout the code | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ matrix.branch }} | ||
- name: Install Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
- name: Install Deps | ||
run: npm install | ||
- name: Test | ||
run: npm run test:coverage | ||
- name: Generate upload artifact name | ||
run: | | ||
name=$(echo -n "${{ matrix.branch }}" | sed -e 's/[ \t:\/\\"<>|*?]/-/g' -e 's/--*/-/g') | ||
echo "ARTIFACT_NAME_UPLOAD=$name" >> $GITHUB_ENV | ||
- name: Upload Coverage | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-${{ env.ARTIFACT_NAME_UPLOAD }} | ||
path: tests/reports/coverage | ||
|
||
report-coverage: | ||
needs: get-coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Generate download artifact name | ||
run: | | ||
name=$(echo -n "${{ github.head_ref }}" | sed -e 's/[ \t:\/\\"<>|*?]/-/g' -e 's/--*/-/g') | ||
echo "ARTIFACT_NAME_DOWNLOAD=$name" >> $GITHUB_ENV | ||
- name: Download Coverage Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: coverage-${{ env.ARTIFACT_NAME_DOWNLOAD }} | ||
path: coverage | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: coverage-main | ||
path: coverage-main | ||
- name: Report Coverage | ||
uses: davelosert/vitest-coverage-report-action@v2 | ||
with: | ||
json-summary-compare-path: coverage-main/coverage-summary.json | ||
file-coverage-mode: all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import '@/array.js'; | ||
import '@/constructor.js'; | ||
import '@/dictionary.js'; | ||
import '@/emptyObject.js'; | ||
import '@/event/types.js'; | ||
import '@/mapping.js'; | ||
import { describe, expect, test } from 'vitest'; | ||
|
||
describe('dummy types test', () => { | ||
test('dummy', () => { | ||
expect(true).toBe(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters