-
Notifications
You must be signed in to change notification settings - Fork 63
56 lines (48 loc) · 1.26 KB
/
reusable_workflow_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
name: 'Reusable workflow / Unit tests'
on:
workflow_call:
inputs:
ref:
description: 'The branch, tag or SHA to checkout'
default: ${{ github.ref }}
required: false
type: string
jobs:
test:
runs-on: ubuntu-latest
name: Run unit tests
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Node setup
uses: ./.github/actions/node-setup
- name: Run tests
run: yarn run test:ci
- name: Upload test artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: test-output
path: |
test-results.json
.nyc_output/coverage-final.json
deploy_test_coverage:
if: ${{ !cancelled() && (success() || failure()) }}
needs: test
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download test artifact
uses: actions/download-artifact@v4
with:
name: test-output
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
use_oidc: true
files: .nyc_output/coverage-final.json
fail_ci_if_error: true