chore(deps): update dependency jsdom to v20.0.3 (#65) #81
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Github Action Demo #工作流程名称 | |
on: #定义触发actions的事件 | |
push: | |
branches: #启用筛选,当main分支上触发push的时候,执行工作流 | |
- main | |
jobs: | |
Build: #jobs的ID 唯一 | |
runs-on: ubuntu-latest #运行的系统 | |
steps: | |
- uses: actions/checkout@v3 # 此处 actions/checkout 操作是从仓库拉取代码到Runner里的操作 | |
- uses: pnpm/action-setup@v2 # 安装pnpm包管理工具 | |
- uses: actions/setup-node@v3 # actions/setup-node@v3 操作来安装指定版本的 Node.js,此处指定安装的版本为v16 | |
with: | |
node-version: 16.x | |
cache: pnpm | |
- name: Install | |
run: pnpm install # 安装依赖 | |
- name: test-vitest | |
run: pnpm run test # 运行vitest 进行单元测试 | |
# - name Lint | |
# run: pnpm run lint | |
# typecheck: #jobs的ID 唯一 | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
#多维矩阵 | |
matrix_test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
version: [14.x, 16.x] | |
fail-fast: false #失败处理 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set node version to ${{ matrix.node_version }} | |
uses: actions/setup-node@v3 | |
- uses: pnpm/action-setup@v2 | |
with: | |
node-version: ${{ matrix.version }} | |
- name: Install | |
run: pnpm install | |
- name: test-vitest | |
run: pnpm run test |