Files
xgj/npm-install/examples/basic-npm.yml

36 lines
697 B
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 基础npm项目示例
name: 基础npm项目CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
- name: 设置Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: 安装依赖
uses: actions/xgj/npm-install@v1
# 使用默认配置npm包管理器不强制安装不启用git stash
- name: 运行linting
run: npm run lint
- name: 运行测试
run: npm test
- name: 构建项目
run: npm run build