From d761d2d185692462c1a91585d51162cf02a19ac6 Mon Sep 17 00:00:00 2001 From: hiroki osame Date: Fri, 18 Nov 2022 21:32:35 -0500 Subject: [PATCH] ci: use pnpm (#1) --- .github/workflows/release.yml | 21 ++++++++++++--------- .github/workflows/test.yml | 19 +++++++++++-------- .nvmrc | 2 +- package.json | 3 +-- 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f366e8d..1f651fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,28 +8,31 @@ jobs: release: name: Release runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 5 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Setup Node.js - uses: actions/setup-node@v2 + - name: Use Node.js + uses: actions/setup-node@v3 with: node-version-file: '.nvmrc' - - name: Install dependencies - run: npx ci + - name: Setup pnpm + uses: pnpm/action-setup@v2.2.2 + with: + version: 7 + run_install: true - name: Test - run: npm test + run: pnpm test - name: Lint - run: npm run lint + run: pnpm lint - name: Release env: GH_TOKEN: ${{ secrets.GH_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npx semantic-release + run: pnpm dlx semantic-release diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4051172..b4241ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,22 +10,25 @@ jobs: test: name: Test runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 5 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Setup Node.js - uses: actions/setup-node@v2 + - name: Use Node.js + uses: actions/setup-node@v3 with: node-version-file: '.nvmrc' - - name: Install dependencies - run: npx ci + - name: Setup pnpm + uses: pnpm/action-setup@v2.2.2 + with: + version: 7 + run_install: true - name: Test - run: npm test + run: pnpm test - name: Lint - run: npm run lint + run: pnpm lint diff --git a/.nvmrc b/.nvmrc index dac255d..e44a38e 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v16.15.1 +v18.12.1 diff --git a/package.json b/package.json index 99ec320..ef8e2cc 100644 --- a/package.json +++ b/package.json @@ -40,8 +40,7 @@ "scripts": { "build": "pkgroll --target=node12.20 --minify", "lint": "eslint --cache .", - "pretest": "npm run build", - "test": "tsx tests", + "test": "pnpm build && tsx tests", "dev": "tsx watch --conditions=development tests", "prepack": "clean-pkg-json" },