From f232c19a974b52d688490aa55aaccaec4df6639a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Mon, 30 Sep 2024 14:49:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20CI=20=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=EF=BC=8C=E4=BD=BF=E7=94=A8=E6=96=B0=E7=9A=84=20compos?= =?UTF-8?q?ite=20action=20=E8=AE=BE=E7=BD=AE=20Node.js=20=E5=92=8C=20PNPM?= =?UTF-8?q?=20=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- setup-node-pnpm-install/action.yml | 34 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 setup-node-pnpm-install/action.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae5adf8..f780027 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 \ No newline at end of file diff --git a/setup-node-pnpm-install/action.yml b/setup-node-pnpm-install/action.yml new file mode 100644 index 0000000..78076d7 --- /dev/null +++ b/setup-node-pnpm-install/action.yml @@ -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 \ No newline at end of file