mirror of
https://git.bjxgj.com/xgj/xgj-actions.git
synced 2025-10-14 06:33:37 +08:00
36 lines
744 B
YAML
36 lines
744 B
YAML
# 基础pnpm项目示例
|
|
name: pnpm项目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'
|
|
|
|
- name: 安装依赖
|
|
id: deps
|
|
uses: actions/xgj/pnpm-install@v1
|
|
with:
|
|
cache-hash: ${{ hashFiles('pnpm-lock.yaml') }}
|
|
|
|
- name: 运行测试
|
|
run: pnpm test
|
|
|
|
- name: 打印缓存状态
|
|
run: |
|
|
echo "cache-hit: ${{ steps.deps.outputs['cache-hit'] }}"
|
|
echo "cache-key: ${{ steps.deps.outputs['cache-key'] }}"
|