From 91e5710945c5c4f6e73b2b56c98ff18066330708 Mon Sep 17 00:00:00 2001 From: ahnpnl <27772165+ahnpnl@users.noreply.github.com> Date: Tue, 7 May 2024 13:01:44 +0700 Subject: [PATCH] ci: improve pipeline for source codes verification - Rename CI config file from `ci` -> `source_codes_ci` - Add `paths-ignore` to skip CI running when changing to `website` - Adjust cache restore key name to use workflow input `os` instead of runner OS --- .github/workflows/code_standard_check.yml | 14 ++++++++------ .github/workflows/install.yml | 12 +++++++----- .github/workflows/{ci.yml => source_codes_ci.yml} | 6 +++++- .github/workflows/test.yml | 14 ++++++++------ 4 files changed, 28 insertions(+), 18 deletions(-) rename .github/workflows/{ci.yml => source_codes_ci.yml} (92%) diff --git a/.github/workflows/code_standard_check.yml b/.github/workflows/code_standard_check.yml index 947e427caa..af8ec7d36b 100644 --- a/.github/workflows/code_standard_check.yml +++ b/.github/workflows/code_standard_check.yml @@ -18,12 +18,13 @@ jobs: runs-on: ${{ inputs.os }} steps: - - uses: actions/checkout@v4 + - name: Checkout ๐Ÿ›Ž๏ธ + uses: actions/checkout@v4 with: fetch-depth: 20 fetch-tags: false - - name: Restore cached node modules + - name: Restore cached node modules โ™ป๏ธ id: cache-yarn uses: actions/cache@v4 with: @@ -36,14 +37,15 @@ jobs: examples/example-app-yarn-workspace/node_modules key: ${{ inputs.os }}-${{ inputs.node }}-build-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-${{ inputs.node }}-build + ${{ inputs.os }}-${{ inputs.node }}-build - - uses: actions/setup-node@v4 + - name: Setup Node version โš™๏ธ + uses: actions/setup-node@v4 with: node-version: ${{ inputs.node }} - - name: Run ESLint check + - name: Run ESLint check ๐Ÿ”๏ธ run: yarn lint - - name: Run Prettier check + - name: Run Prettier check ๐Ÿ”๏ธ run: yarn lint-prettier-ci diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 54cdd21780..fafb4c2871 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -19,12 +19,13 @@ jobs: runs-on: ${{ inputs.os }} steps: - - uses: actions/checkout@v4 + - name: Checkout ๐Ÿ›Ž๏ธ + uses: actions/checkout@v4 with: fetch-depth: 20 fetch-tags: false - - name: Restore cached node modules + - name: Restore cached node modules โ™ป๏ธ id: cache-yarn uses: actions/cache@v4 with: @@ -37,14 +38,15 @@ jobs: examples/example-app-yarn-workspace/node_modules key: ${{ inputs.os }}-${{ inputs.node }}-build-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-${{ inputs.node }}-build + ${{ inputs.os }}-${{ inputs.node }}-build - - uses: actions/setup-node@v4 + - name: Setup Node version โš™๏ธ + uses: actions/setup-node@v4 if: ${{ steps.cache-yarn.outputs.cache-hit != 'true' }} with: node-version: ${{ inputs.node }} - - name: Install dependencies + - name: Install ๐Ÿ”ง if: ${{ steps.cache-yarn.outputs.cache-hit != 'true' }} run: | yarn --immutable diff --git a/.github/workflows/ci.yml b/.github/workflows/source_codes_ci.yml similarity index 92% rename from .github/workflows/ci.yml rename to .github/workflows/source_codes_ci.yml index a018ead95b..e91bfa30eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/source_codes_ci.yml @@ -1,12 +1,16 @@ -name: CI +name: Source codes CI on: push: branches: - main + paths-ignore: + - 'website/**' pull_request: branches: - '**' + paths-ignore: + - 'website/**' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b3d26617f8..1c8a61166f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,12 +18,13 @@ jobs: runs-on: ${{ inputs.os }} steps: - - uses: actions/checkout@v4 + - name: Checkout ๐Ÿ›Ž๏ธ + uses: actions/checkout@v4 with: fetch-depth: 20 fetch-tags: false - - name: Restore cached node modules + - name: Restore cached node modules โ™ป๏ธ id: cache-yarn uses: actions/cache@v4 with: @@ -36,14 +37,15 @@ jobs: examples/example-app-yarn-workspace/node_modules key: ${{ inputs.os }}-${{ inputs.node }}-build-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-${{ inputs.node }}-build + ${{ inputs.os }}-${{ inputs.node }}-build - - uses: actions/setup-node@v4 + - name: Setup Node version โš™๏ธ + uses: actions/setup-node@v4 with: node-version: ${{ inputs.node }} - - name: Run tests + - name: Run tests ๐Ÿงช run: yarn test - - name: Run tests in example projects + - name: Run tests in example projects ๐Ÿงช run: yarn test-examples