更新 CI 工作流,使用新的 composite action 设置 Node.js 和 PNPM 环境
Some checks failed
/ another-job (push) Failing after 7s

This commit is contained in:
严浩
2024-09-30 14:49:46 +08:00
parent afca04fa2e
commit f232c19a97
2 changed files with 35 additions and 1 deletions

View File

@ -4,7 +4,7 @@ jobs:
another-job:
runs-on: ubuntu-latest
steps:
- uses: yanhao98/composite-actions/action.yml@main
- uses: yanhao98/composite-actions/setup-node-pnpm-install@main
- run: |
node --version
pnpm --version

View File

@ -0,0 +1,34 @@
# 🔗 Links:
# Source file: https://github.com/obytes/react-native-template-obytes/blob/master/.github/actions/setup-node-pnpm-install/action.yml
# Composite actions docs: https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
# ✍️ Description:
# This is a composite action, which means it can be used in other actions.
# It is used in almost all workflows to set up the environment and install dependencies.
# Updating the package manager or Node version here will be reflected in all workflows.
# 👀 Example usage:
# - name : 📦 Setup Node + PNPM + install deps
# uses: ./.github/actions/setup-node-pnpm-install
name: 'Setup Node + PNPM + Install Dependencies'
description: 'Setup Node + PNPM + Install Dependencies'
runs:
using: 'composite'
steps:
- uses: pnpm/action-setup@v4
with:
version: latest
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
# cache: 'pnpm'
- name: Check Node and PNPM versions
shell: bash
run: |
node --version
pnpm --version
# - name: 📦 Install Project Dependencies
# run: pnpm install --frozen-lockfile
# shell: bash