Skip to content

Commit

Permalink
build: use pnpm (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Aug 3, 2023
1 parent f5b662c commit 66db3bf
Show file tree
Hide file tree
Showing 6 changed files with 7,604 additions and 6,593 deletions.
38 changes: 23 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,28 @@ jobs:
with:
fetch-depth: 2

- name: Enable corepack
run: corepack enable

- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
cache: pnpm

- name: Init platform
shell: bash
run: |
git config --global core.autocrlf false
git config --global core.symlinks true
echo 'Node $(node --version)'
echo 'Yarn $(yarn --version)'
echo 'pnpm $(pnpm --version)'
- name: Installing dependencies
run: yarn install --frozen-lockfile --ignore-engines # semantic release will fail to install otherwise
run: pnpm install

- name: Run tests
run: yarn jest --maxWorkers=2 --ci --coverage ${{ env.coverage }} --logHeapUsage
run: pnpm jest --maxWorkers=2 --ci --coverage ${{ env.coverage }} --logHeapUsage

- name: Codecov
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
Expand All @@ -83,30 +86,33 @@ jobs:
with:
fetch-depth: 2

- name: Enable corepack
run: corepack enable

- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
cache: pnpm

- name: Init platform
run: |
git config --global core.autocrlf false
git config --global core.symlinks true
echo 'Node $(node --version)'
echo 'Yarn $(yarn --version)'
echo 'pnpm $(pnpm --version)'
- name: Installing dependencies
run: yarn install --frozen-lockfile
run: pnpm install

- name: Lint
run: |
yarn eslint -f gha
yarn markdown-lint
yarn prettier
pnpm eslint -f gha
pnpm markdown-lint
pnpm prettier
# - name: Type check
# run: yarn type-check
# run: pnpm type-check

release:
needs: [lint, test]
Expand All @@ -121,19 +127,21 @@ jobs:
with:
fetch-depth: 0

- name: Enable corepack
run: corepack enable

- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
cache: pnpm

- name: Init platform
run: |
git config --global core.autocrlf false
git config --global core.symlinks true
git config --global user.email ${GIT_EMAIL}
git config --global user.name 'Renovate Bot'
yarn config set version-git-tag false
- name: Check dry run
run: |
Expand All @@ -146,11 +154,11 @@ jobs:
fi
- name: Installing dependencies
run: yarn install --frozen-lockfile
run: pnpm install

- name: semantic-release
run: |
yarn semantic-release --dry-run ${{env.DRY_RUN}}
pnpm semantic-release --dry-run ${{env.DRY_RUN}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

# shellcheck disable=SC1091
# shellcheck source=/dev/null
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
pnpm lint-staged
1 change: 0 additions & 1 deletion .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

// Define glob expressions to ignore
"ignores": [
".yarn",
"**/node_modules/**",
"**/TestResults/**",
"**/bin/**",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"main": "index.js",
"engines": {
"node": "^18.12.0 || >= 20.0.0",
"yarn": "^1.17.0"
"pnpm": "^8.6.11"
},
"scripts": {
"eslint": "eslint .",
Expand Down Expand Up @@ -55,5 +55,5 @@
"prettier-plugin-package": "1.3.1",
"semantic-release": "21.0.7"
},
"packageManager": "yarn@1.22.19"
"packageManager": "pnpm@8.6.11"
}

0 comments on commit 66db3bf

Please sign in to comment.