Skip to content

Commit

Permalink
build: Add Lint Workflows for cli and sdk-node
Browse files Browse the repository at this point in the history
build: Add Lint Workflows for `cli` and `sdk-node`
  • Loading branch information
rajdip-b authored Dec 29, 2023
2 parents a7a40ab + 0da0953 commit 93ae134
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ jobs:
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install packages
run: |
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/cli.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
on:
push:
paths: ['apps/cli/**', '.github/workflows/cli.yaml']
pull_request:
paths: ['apps/cli/**']

jobs:
validate:
runs-on: ubuntu-latest
name: Validate

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install packages
run: |
pnpm i
- name: Lint
run: |
pnpm run lint:cli
- name: Test
run: |
pnpm run test:cli
50 changes: 50 additions & 0 deletions .github/workflows/sdk-node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
push:
paths: ['packages/sdk-node/**', '.github/workflows/sdk-node.yaml']
pull_request:
paths: ['packages/sdk-node']

jobs:
validate:
runs-on: ubuntu-latest
name: Validate

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install packages
run: |
pnpm i
- name: Lint
run: |
pnpm run lint:sdk-node
- name: Test
run: |
pnpm run test:sdk-node
13 changes: 13 additions & 0 deletions .github/workflows/web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ jobs:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install packages
run: |
pnpm i
Expand Down

0 comments on commit 93ae134

Please sign in to comment.