From 18475653f93c24ff6c401be4681f7294edd1a816 Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Sun, 17 Dec 2023 00:05:49 +0900 Subject: [PATCH] ci(.github/pnpm/setup-node.yml): pnpm action (#462) # Overview add pnpm action to keep consistency ## PR Checklist - [x] I did below actions if need 1. I read the [Contributing Guide](https://github.com/suspensive/react/blob/main/CONTRIBUTING.md) 2. I added documents and tests. --- .github/actions/pnpm-setup-node/action.yml | 13 +++++++++++++ .github/workflows/ci.yml | 9 +-------- .github/workflows/code-coverage.yml | 9 +-------- .github/workflows/graph.yml | 9 +-------- .github/workflows/release.yml | 9 +-------- 5 files changed, 17 insertions(+), 32 deletions(-) create mode 100644 .github/actions/pnpm-setup-node/action.yml 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