-
Notifications
You must be signed in to change notification settings - Fork 15
74 lines (67 loc) · 1.76 KB
/
test.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Tag and Release Updated NPM Package
on:
pull_request_target:
push:
branches:
- main
- next
- beta
- "*.x"
repository_dispatch:
types: [semantic-release]
concurrency:
group: ci-${{ github.event.pull_request.number }}${{ github.ref }}${{ github.workflow }}
cancel-in-progress: true
permissions:
issues: write
pull-requests: write
statuses: write
checks: write
actions: write
id-token: write
contents: write
jobs:
run-tests:
name: Run unit tests
runs-on: ubuntu-latest
env:
SKIP_PREFLIGHT_CHECK: true
steps:
- uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref || github.ref }}
- name: Install compatible Nodejs version
id: setup-node
uses: ./.github/actions/setup-node
- name: Configure PATH
run: |
mkdir -p "$HOME/.local/bin"
echo "$HOME/.local/bin" >> "${GITHUB_PATH}"
echo "HOME=$HOME" >> "${GITHUB_ENV}"
- run: npm install
- run: npm run test
- run: npm run coverage
- name: 'Report Coverage'
if: always()
continue-on-error: true
uses: davelosert/vitest-coverage-report-action@v2.5.0
with:
json-summary-path: './out/coverage-summary.json'
json-final-path: ./out/coverage-final.json
- run: npm run build
- run: npm run generate-docs
call-workflow-passing-data:
needs: run-tests
if: ${{ github.event_name == 'push' }}
permissions:
issues: write
pull-requests: write
statuses: write
checks: write
actions: write
id-token: write
contents: write
uses: ./.github/workflows/deploy.yml
with:
ref: ${{ github.head_ref || github.ref }}
secrets: inherit