Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate to pnpm #617

Merged
merged 7 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(ci): install pnpm and store cache
  • Loading branch information
rxri committed Oct 17, 2023
commit 96a9e484de407224a7acc368160d0eb9f7962fe8
22 changes: 20 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Build

on:
# Run build tests on pull requests
pull_request:
branches:
- main
Expand All @@ -14,11 +13,30 @@ jobs:
- name: Checkout Project
uses: actions/checkout@v3

- name: Use Node.js 20
- name: Install Node.js (v20)
uses: actions/setup-node@v3.1.0
with:
node-version: 20

- name: Install pnpm (v8)
uses: pnpm/action-setup@v2
with:
version: latest
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: Install dependencies
run: pnpm install --frozen-lockfile

Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Lint
name: Lint code

on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
Expand All @@ -18,12 +16,29 @@ jobs:
- name: Checkout Project
uses: actions/checkout@v4

- name: Setup Node.js
- name: Install Node.js (v20)
uses: actions/setup-node@v3
with:
node-version: 20
cache: pnpm
cache-dependency-path: pnpm.lock

- name: Install pnpm (v8)
uses: pnpm/action-setup@v2
with:
version: latest
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: Install Dependencies
run: pnpm install --frozen-lockfile
Expand Down
27 changes: 20 additions & 7 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ on:
push:
branches:
- main
workflow_call:
# pull_request:
# branches:
# - main

jobs:
deploy:
Expand All @@ -22,12 +18,29 @@ jobs:
with:
fetch-depth: 0

- name: Setup Node.js
- name: Install Node.js (v20)
uses: actions/setup-node@v3
with:
node-version: 20
cache: pnpm
cache-dependency-path: pnpm.lock

- name: Install pnpm (v8)
uses: pnpm/action-setup@v2
with:
version: latest
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: Configure Git
run: |
Expand Down