-
Notifications
You must be signed in to change notification settings - Fork 25
32 lines (31 loc) · 1.06 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
name: Test
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
jobs:
test-node:
name: Unit Tests
runs-on: [self-hosted, Linux, medium, ephemeral]
permissions:
checks: write
pull-requests: write
contents: read
steps:
- name: Setup NodeJS Environment
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 18.x
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: npm install
- name: Run tests (Forked PR)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && !cancelled() && !failure() }}
run: npm run test
- name: Test
uses: ArtiomTr/jest-coverage-report-action@v2
if: ${{ ((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'push') && !cancelled() && !failure() }}
with:
test-script: npm run test