-
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (51 loc) · 1.43 KB
/
testing.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Testing
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Use Node LTS version
uses: actions/setup-node@v4
with:
cache: yarn
node-version: 20
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run test suite
run: yarn test
coverage:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: yarn
node-version: 20
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run coverage report
run: yarn coverage
- uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ github.run_id }}
path: |
coverage/**/*.json
- name: Coverage summary
uses: irongut/[email protected]
with:
filename: coverage/cobertura-coverage.xml
format: 'markdown'
output: 'both'
- name: Add coverage PR comment
uses: marocchino/[email protected]
with:
recreate: true
path: code-coverage-results.md
- name: Write to job summary
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY