Skip to content

Commit

Permalink
chore: using pnpm on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrabdev committed Jun 5, 2024
1 parent d9315f1 commit 8aa3e97
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 70 deletions.
Empty file.
159 changes: 89 additions & 70 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,129 +5,148 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node 20
uses: actions/setup-node@v4
- uses: pnpm/action-setup@v2
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
cache: "pnpm"
- name: Add pnpm store path to env var
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Cache node modules
uses: actions/cache@v4
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-
${{ runner.os }}-pnpm-store-
js-lint:
needs: install_modules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node 20
uses: actions/setup-node@v4
- uses: pnpm/action-setup@v2
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
cache: "pnpm"
- name: Add pnpm store path to env var
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: TRY
shell: bash
run: echo $STORE_PATH
- name: Restore cache
uses: actions/cache@v4
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-
${{ runner.os }}-pnpm-store-
- name: JS linting
run: npm run lint:js
run: pnpm run lint:js

md-lint:
needs: install_modules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node 20
uses: actions/setup-node@v4
- uses: pnpm/action-setup@v2
with:
node-version: "20.x"
cache: "npm"
- name: Restore cache
uses: actions/cache@v4
run_install: false
- uses: actions/setup-node@v4
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
node-version: "20.x"
cache: "pnpm"
# - name: Restore cache
# uses: actions/cache@v4
# with:
# path: |
# ~/.npm
# **/node_modules
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-
- name: MDX linting
run: npm run lint:md
run: pnpm run lint:md

format:
needs: install_modules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node 20
uses: actions/setup-node@v4
- uses: pnpm/action-setup@v2
with:
node-version: "20.x"
cache: "npm"
- name: Restore cache
uses: actions/cache@v4
run_install: false
- uses: actions/setup-node@v4
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
node-version: "20.x"
cache: "pnpm"
# - name: Restore cache
# uses: actions/cache@v4
# with:
# path: |
# ~/.npm
# **/node_modules
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-
- name: Run formatting
run: npm run format:js
run: pnpm run format:js

spell-check:
needs: install_modules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node 20
uses: actions/setup-node@v4
- uses: pnpm/action-setup@v2
with:
node-version: "20.x"
cache: "npm"
- name: Restore cache
uses: actions/cache@v4
run_install: false
- uses: actions/setup-node@v4
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
node-version: "20.x"
cache: "pnpm"
# - name: Restore cache
# uses: actions/cache@v4
# with:
# path: |
# ~/.npm
# **/node_modules
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-
- name: Run Spellcheck
run: npm run spellcheck:lint
run: pnpm run spellcheck:lint

build:
needs: install_modules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node 20
uses: actions/setup-node@v4
- uses: pnpm/action-setup@v2
with:
node-version: "20.x"
cache: "npm"
- name: Restore cache
uses: actions/cache@v4
run_install: false
- uses: actions/setup-node@v4
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
node-version: "20.x"
cache: "pnpm"
# - name: Restore cache
# uses: actions/cache@v4
# with:
# path: |
# ~/.npm
# **/node_modules
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-
- name: Building app
run: npm run build
run: pnpm run build
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"name": "inkchain-docs",
"packageManager": "[email protected]",
"scripts": {
"dev": "next dev",
"build": "next build",
Expand Down

0 comments on commit 8aa3e97

Please sign in to comment.