This repository has been archived by the owner on Nov 8, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (68 loc) · 1.73 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
81
82
83
84
85
86
87
88
name: Test
on:
schedule:
- cron: "0 0 1 * *"
push:
branches:
- main
pull_request:
workflow_call:
jobs:
test:
name: Test
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
node-version:
- 16
- 18
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Use PNPM
uses: pnpm/action-setup@v2
with:
version: 7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache: pnpm
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: pnpm i
- name: Check code styles
run: pnpm lint
- name: Build CommonJS
run: pnpm build
- name: Build ECMAScript
run: pnpm build:esm
- name: Get number of CPU cores
id: cpu-cores
uses: SimenB/github-actions-cpu-cores@v1
- name: Test the project
run: pnpm test:ci --maxWorkers ${{ steps.cpu-cores.outputs.count }}
- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v3
if: ${{ github.event_name != 'schedule'}}
env:
OS: ${{ runner.os }}
ARCH: ${{ runner.arch }}
NODE_VERSION: ${{ matrix.node-version }}
REF: ${{ github.ref_name }}
with:
env_vars: OS,ARCH,NODE_VERSION,REF
fail_ci_if_error: true
test-summary:
name: Test Summary
needs:
- test
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Check test matrix status
if : ${{ needs.test.result != 'success' }}
run : exit 1