Skip to content

Commit

Permalink
ci(pnpm): setup pnpm, add lockfile and fix the ci (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
100terres authored Oct 20, 2022
1 parent e91ae7d commit d01c089
Show file tree
Hide file tree
Showing 8 changed files with 4,916 additions and 11 deletions.
38 changes: 38 additions & 0 deletions .github/actions/setup-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: setup-install
description: "Setup Node and install depedencies using pnpm and it's cache"

runs:
using: composite
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm install
9 changes: 3 additions & 6 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm run lint
- uses: actions/checkout@v2
- uses: ./.github/actions/setup-install
- run: pnpm run lint
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit $1
pnpm dlx commitlint --edit $1
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm test
pnpm test
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion .release-it.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module.exports = {
hooks: {
"before:init": ["npm test"],
"before:init": ["pnpm test"],
},
git: {
commitMessage: "chore: release ${version}",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"lint": "eslint .",
"prepare": "husky install",
"release": "release-it",
"test": "npm run lint"
"test": "pnpm run lint"
},
"peerDependencies": {
"eslint": "^8.0.0",
Expand Down
Loading

0 comments on commit d01c089

Please sign in to comment.