diff --git a/.github/actions/pnpm-setup-node/action.yml b/.github/actions/pnpm-setup-node/action.yml new file mode 100644 index 000000000..adcb77aad --- /dev/null +++ b/.github/actions/pnpm-setup-node/action.yml @@ -0,0 +1,13 @@ +name: setup pnpm & node +description: setup pnpm & node +runs: + using: composite + steps: + - uses: pnpm/action-setup@v2 + with: + version: 8.12.0 + - uses: actions/setup-node@v4 + with: + cache: "pnpm" + cache-dependency-path: "pnpm-lock.yaml" + node-version-file: ".nvmrc" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33d2b3477..737a69c67 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,14 +22,7 @@ jobs: command: ['lint', 'lint:attw', 'lint:monorepo', 'lint:pub', 'test', 'test:tsd', 'type:check', 'build'] steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8.12.0 - - uses: actions/setup-node@v4 - with: - cache: 'pnpm' - cache-dependency-path: 'pnpm-lock.yaml' - node-version-file: '.nvmrc' + - uses: ./.github/actions/pnpm-setup-node - run: pnpm install --frozen-lockfile - if: matrix.command == 'test' run: pnpm exec playwright install diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index 69843e7d8..88d4950b3 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -19,14 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8.12.0 - - uses: actions/setup-node@v4 - with: - cache: 'pnpm' - cache-dependency-path: 'pnpm-lock.yaml' - node-version-file: '.nvmrc' + - uses: ./.github/actions/pnpm-setup-node - run: pnpm install --frozen-lockfile - run: pnpm exec playwright install - run: pnpm test diff --git a/.github/workflows/graph.yml b/.github/workflows/graph.yml index c27eb3314..3cfd3b37f 100644 --- a/.github/workflows/graph.yml +++ b/.github/workflows/graph.yml @@ -19,14 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8.12.0 - - uses: actions/setup-node@v4 - with: - cache: 'pnpm' - cache-dependency-path: 'pnpm-lock.yaml' - node-version-file: '.nvmrc' + - uses: ./.github/actions/pnpm-setup-node - name: Setup Pages uses: actions/configure-pages@v3 - name: Install dependencies diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4354617af..802c5ce5a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,14 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8.12.0 - - uses: actions/setup-node@v4 - with: - cache: 'pnpm' - cache-dependency-path: 'pnpm-lock.yaml' - node-version-file: '.nvmrc' + - uses: ./.github/actions/pnpm-setup-node - run: pnpm install --frozen-lockfile - name: Create Changesets Pull Request or Publish to NPM id: changesets