-
Notifications
You must be signed in to change notification settings - Fork 91
59 lines (47 loc) · 1.31 KB
/
unit-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
name: 🌈 Unit Test
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 # Skip downloading during yarn install
PLAYWRIGHT_BROWSERS_PATH: 0 # Places binaries to node_modules/@playwright/test
NPM_CONFIG_REGISTRY: https://registry.npmjs.org/
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: # 允许手动触发,并可以指定分支
inputs:
branch:
description: 'Branch to release from'
required: true
default: 'main' # 默认使用 main 分支
type: string
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: [20.x]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PNPM
run: corepack enable
- name: Set node
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: pnpm
- name: Setup
run: npm i -g pnpm
- name: Reset pnpm registry
run: pnpm config set registry https://registry.npmjs.org/
- name: Setup dependencies
run: pnpm install --no-frozen-lockfile --registry=https://registry.npmjs.org/
- name: Build
run: pnpm build
- name: Unit Test
run: pnpm test:unit