From 8381b5902c89503199a3c09001e46b13c13e3cbc Mon Sep 17 00:00:00 2001 From: Akira Hayashi Date: Sat, 1 Jun 2024 03:48:13 +0900 Subject: [PATCH] Separate workflow for check to use it also from CD workflow --- .github/workflows/check.yaml | 28 ++++++++++++++++++++++++++++ .github/workflows/ci.yaml | 25 +++---------------------- 2 files changed, 31 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/check.yaml diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml new file mode 100644 index 0000000..add652e --- /dev/null +++ b/.github/workflows/check.yaml @@ -0,0 +1,28 @@ +name: Check Package + +on: + workflow_call: + +jobs: + ci: + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install pnpm + run: npm install -g pnpm + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.node-version' + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Run tests + run: pnpm test diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 31e63f7..6cf313d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: CI on pull request +name: CI for before & after Pull Request Merge on: pull_request: @@ -7,24 +7,5 @@ on: - main jobs: - ci: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install pnpm - run: npm install -g pnpm - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: '.node-version' - cache: 'pnpm' - - - name: Install dependencies - run: pnpm install - - - name: Run tests - run: pnpm test + call-common-checks: + uses: ./.github/workflows/check.yaml