-
Notifications
You must be signed in to change notification settings - Fork 25
57 lines (47 loc) · 1.36 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
name: "Test"
on:
workflow_dispatch:
push:
branches:
- "**"
# A pull request sent from a fork of the upstream repository could be manipulated to do harmful things.
# The upstream repository’s maintainer would have no protection against this attack, as pull requests
# can be sent by anyone who forks the repository on GitHub.
# This is why we don't run automated tests on every PR.
# pull_request:
# types:
# - opened
# - synchronize
# paths-ignore:
# - '*.md'
jobs:
skipci:
runs-on: ubuntu-22.04
steps:
- run: echo "[Skip CI] ${{ contains(github.event.head_commit.message, '[skip ci]') }}"
test:
runs-on: ${{ matrix.os }}
if: contains(github.event.head_commit.message, '[skip ci]') == false
strategy:
matrix:
os:
- "ubuntu-22.04"
- "macos-latest"
- "windows-latest"
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- run: npm ci
- name: Run prettier
if: startsWith(matrix.os, 'ubuntu')
run: npm run format:check
- name: Run eslint
if: startsWith(matrix.os, 'ubuntu')
run: npm run lint
- name: Run ncc
if: startsWith(matrix.os, 'ubuntu')
run: npm run build
- run: npm test