Skip to content

Commit

Permalink
fix: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jrson83 committed Feb 8, 2025
1 parent 5deb746 commit 3e25f28
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,28 @@ on:

pull_request:
branches: [main]
paths:
- '**.ts'
- 'package.json'
- 'pnpm-lock.yaml'
- '.github/workflows/*.yml'

push:
branches: [main]
paths:
- '**.ts'
- 'package.json'
- 'pnpm-lock.yaml'
- '.github/workflows/*.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

env:
CI: true
NPM_VERSION: 20.10.0
PNPM_VERSION: 10.2.1

jobs:
ci:
Expand All @@ -24,37 +39,22 @@ jobs:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Node environment
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: 20.10.0

- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
name: Install pnpm
id: pnpm-install
- name: Setup PNPM
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
with:
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
version: ${{ env.PNPM_VERSION }}

- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
name: Setup pnpm cache
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
node-version: ${{ env.NPM_VERSION }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
run: pnpm install --frozen-lockfile --prefer-offline

- name: Run build
run: pnpm run build
run: pnpm build

- name: Run test
run: pnpm run test
run: pnpm test

0 comments on commit 3e25f28

Please sign in to comment.