Skip to content

Commit

Permalink
ci: improve pipeline for source codes verification
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
ahnpnl committed May 7, 2024
1 parent cf8d2f6 commit 91e5710
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 18 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/code_standard_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
12 changes: 7 additions & 5 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 }}
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

0 comments on commit 91e5710

Please sign in to comment.