-
Notifications
You must be signed in to change notification settings - Fork 16
48 lines (41 loc) · 1.16 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
name: Tests
on:
push:
# Triggers the workflow on labeled PRs only.
pull_request_target:
types: [labeled]
jobs:
test:
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || github.event_name == 'push'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
env:
NPM_CONFIG_IGNORE_SCRIPTS: true
steps:
# Prerequisites
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: "16"
# Clean install project
- name: Clean install
run: npm ci
# Run lint
- name: Lint
run: npm run lint
# Run tests
- name: Tests
run: npm run pretest && npm t
env:
CLIENTTESTS_PLATFORM_URL: ${{ secrets.PLATFORM_URL }}
CLIENTTESTS_PLATFORM_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }}
# Send tests coverage to Codecov
- name: Send code coverage
uses: codecov/codecov-action@v3
if: runner.os == 'Linux'