-
Notifications
You must be signed in to change notification settings - Fork 197
43 lines (37 loc) · 1.07 KB
/
reusable_workflow_test.yml
File metadata and controls
43 lines (37 loc) · 1.07 KB
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
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
workspace:
description: 'Workspace to run tests in (if empty, runs tests for all workspaces)'
required: false
type: string
jobs:
test:
runs-on: ubuntu-latest
name: Run unit tests
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.ref }}
- name: Node setup
uses: ./.github/actions/node-setup
- name: Run tests for all workspaces
if: ${{ !inputs.workspace }}
run: yarn run test:ci
- name: Run tests for the specified workspace
if: ${{ inputs.workspace }}
run: yarn workspace ${{ inputs.workspace }} run test:ci
- name: Upload test artifact
if: always()
uses: actions/upload-artifact@v6
with:
name: test-output
path: |
test-results.json
.nyc_output/coverage-final.json