From 0a0c75d3307a11c9c2a4d5b8a95bcef23a3a69fd Mon Sep 17 00:00:00 2001 From: MuhammadM1998 Date: Fri, 24 May 2024 21:19:37 +0300 Subject: [PATCH] refactor: use 'setup' composite actions in workflows --- .github/workflows/publish.yaml | 26 ++------------------------ .github/workflows/release.yaml | 5 ++--- .github/workflows/test.yaml | 25 ++----------------------- 3 files changed, 6 insertions(+), 50 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index fb10d6ad..66710e75 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -50,30 +50,8 @@ jobs: - name: Checkout uses: actions/checkout@v3 - # Run a build step here - - name: Setup Node.js environment - uses: actions/setup-node@v2 - with: - node-version: 18 - - - uses: pnpm/action-setup@v2 - name: Install pnpm - with: - version: 9.1.2 - run_install: false - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - uses: actions/cache@v3 - name: Setup pnpm cache - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- + - name: Setup (Install Node & pnpm) + uses: ./.github/actions/setup - name: Install dependencies run: pnpm i --frozen-lockfile diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7b1d6468..3f2fa36d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -18,9 +18,8 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-node@v3 - with: - node-version: 18.x + - name: Setup (Install Node & pnpm) + uses: ./.github/actions/setup - run: npx changelogithub env: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3cb02036..abc91875 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -21,29 +21,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - - name: Setup Node.js environment - uses: actions/setup-node@v2 - with: - node-version: 18 - - - uses: pnpm/action-setup@v2 - name: Install pnpm - with: - version: 9.1.2 - run_install: false - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - uses: actions/cache@v3 - name: Setup pnpm cache - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- + - name: Setup (Install Node & pnpm) + uses: ./.github/actions/setup - name: Install dependencies run: pnpm i --frozen-lockfile