Skip to content

zhelingwang is learning GitHub Actions #5

zhelingwang is learning GitHub Actions

zhelingwang is learning GitHub Actions #5

Workflow file for this run

name: 自动化测试
run-name: ${{ github.actor }} is learning GitHub Actions
# events 定义触发事件以及条件
on:
push:
branches:
- main
paths:
- '.github/workflows/**'
- '__test__/**'
- 'src/**'
# tags:
# - v1.**
workflow_dispatch:
jobs:
# 第一个任务
test:
# 虚拟机的系统
runs-on: ubuntu-latest
steps:
# 一个 - 就是一个step
# 第三方action: git pull repo code on virtual runner server
- uses: actions/checkout@v2
# 第三方action: 安装nodejs
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 20
- name: lint and test
# 多行写法 | 开头
run: |
npm i
npm run lint
npm run test