-
Notifications
You must be signed in to change notification settings - Fork 86
80 lines (74 loc) · 2.11 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Plugin Tests
on:
pull_request:
push:
branches: [main]
schedule:
- cron: '0 0 * * *'
jobs:
build:
name: Unit tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [12, '*']
exclude:
- os: macOS-latest
node-version: 12
- os: windows-latest
node-version: 12
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Installing with latest Node.js
uses: actions/setup-node@v2
with:
node-version: '*'
check-latest: true
- name: NPM Install
run: npm install
- name: Switching to Node.js ${{ matrix.node-version }} to run tests
uses: actions/setup-node@v2
if: "${{ matrix.node-version != '*' }}"
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- name: Linting
run: npm run format:ci
if: "${{ matrix.node-version == '*' }}"
- name: Run tests against next@latest
run: npm test
canary:
name: Unit tests (Canary)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [12, '*']
exclude:
- os: macOS-latest
node-version: 12
- os: windows-latest
node-version: 12
fail-fast: false
if: github.ref_name == 'main'
steps:
- uses: actions/checkout@v2
- name: Installing with latest Node.js
uses: actions/setup-node@v2
with:
node-version: '*'
check-latest: true
- name: NPM Install
run: npm install
- name: Install Next.js Canary
run: npm install -D next@canary --legacy-peer-deps
- name: Switching to Node.js ${{ matrix.node-version }} to run tests
uses: actions/setup-node@v2
if: "${{ matrix.node-version != '*' }}"
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- name: Run tests against next@canary
run: npm test