From 76277b37784fe704b0aade2006edd59aa6e27302 Mon Sep 17 00:00:00 2001 From: Jonathan MASSUCHETTI Date: Tue, 10 Dec 2024 16:37:41 +0100 Subject: [PATCH] ci: update actions to pnpm --- .github/workflows/release.yml | 31 ++++++++++++++++++++----------- .github/workflows/test.yml | 29 +++++++++++++++++++---------- .nvmrc | 2 +- 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b095e48..e63581c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,24 +9,33 @@ jobs: if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" steps: - uses: actions/checkout@v4 - - - name: Prepare repository - run: git fetch --unshallow --tags - - - name: Use Node.js 18.x - uses: actions/setup-node@v4 + - uses: pnpm/action-setup@v4 + with: + version: 9.15.0 + - uses: actions/setup-node@v4 with: - node-version: 18.x + node-version-file: '.nvmrc' + cache: 'pnpm' + cache-dependency-path: pnpm-lock.yaml - name: Install dependencies - uses: bahmutov/npm-install@v1 + run: pnpm i + + - name: Vitest cache + uses: actions/cache@v4 + with: + path: ./node_modules/.vite/vitest/results.json + key: vitest-cache-${{ github.ref_name }} + restore-keys: | + vitest-cache-${{ github.ref_name }} - - name: Tests - run: npm run test:ci + - name: Run tests + id: tests + run: pnpm vitest --run --bail 5 - name: Create Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: | - npm run release + cd packages/storybook-addon-remix-react-router && pnpm run release diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3330b21..e3185f7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,17 +8,26 @@ jobs: if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" steps: - uses: actions/checkout@v4 - - - name: Prepare repository - run: git fetch --unshallow --tags - - - name: Use Node.js 18.x - uses: actions/setup-node@v4 + - uses: pnpm/action-setup@v4 + with: + version: 9.15.0 + - uses: actions/setup-node@v4 with: - node-version: 18.x + node-version-file: '.nvmrc' + cache: 'pnpm' + cache-dependency-path: pnpm-lock.yaml - name: Install dependencies - uses: bahmutov/npm-install@v1 + run: pnpm i + + - name: Vitest cache + uses: actions/cache@v4 + with: + path: ./node_modules/.vite/vitest/results.json + key: vitest-cache-${{ github.ref_name }} + restore-keys: | + vitest-cache-${{ github.ref_name }} - - name: Tests - run: npm run test:ci + - name: Run tests + id: tests + run: pnpm vitest --run \ No newline at end of file diff --git a/.nvmrc b/.nvmrc index 25bf17f..8fdd954 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18 \ No newline at end of file +22 \ No newline at end of file