mirror of
https://git.bjxgj.com/xgj/xgj-actions.git
synced 2025-10-14 17:33:37 +08:00
feat: 新增pnpm依赖安装与缓存的GitHub Action实现
This commit is contained in:
35
pnpm-install/examples/basic-usage.yml
Normal file
35
pnpm-install/examples/basic-usage.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
# 基础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'] }}"
|
Reference in New Issue
Block a user