From adb6ae7f7fc53d43f7e70f7ce20a9d30859ff025 Mon Sep 17 00:00:00 2001 From: Harsh Patel Date: Fri, 29 Dec 2023 22:31:51 +0530 Subject: [PATCH 1/6] build(cli): add lint workflow --- .github/workflows/cli.yaml | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/cli.yaml diff --git a/.github/workflows/cli.yaml b/.github/workflows/cli.yaml new file mode 100644 index 00000000..621bfbb3 --- /dev/null +++ b/.github/workflows/cli.yaml @@ -0,0 +1,39 @@ +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: Install packages + run: | + pnpm i + + - name: Lint + run: | + pnpm run lint:web + + - name: Test + run: | + pnpm run test:web + + \ No newline at end of file From ff7f4753504f9e76ed1accc65a5cfd991a1204ba Mon Sep 17 00:00:00 2001 From: Harsh Patel Date: Fri, 29 Dec 2023 22:32:07 +0530 Subject: [PATCH 2/6] build(sdk-node): add lint workflow --- .github/workflows/sdk-node.yaml | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/sdk-node.yaml diff --git a/.github/workflows/sdk-node.yaml b/.github/workflows/sdk-node.yaml new file mode 100644 index 00000000..6790d773 --- /dev/null +++ b/.github/workflows/sdk-node.yaml @@ -0,0 +1,37 @@ +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: Install packages + run: | + pnpm i + + - name: Lint + run: | + pnpm run lint:sdk-node + + - name: Test + run: | + pnpm run test:sdk-node From 587f06b4f0497df22cc5a453c8db13fe0c53f2ef Mon Sep 17 00:00:00 2001 From: Harsh Patel Date: Fri, 29 Dec 2023 22:46:43 +0530 Subject: [PATCH 3/6] fix: typo --- .github/workflows/cli.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cli.yaml b/.github/workflows/cli.yaml index 621bfbb3..1569a056 100644 --- a/.github/workflows/cli.yaml +++ b/.github/workflows/cli.yaml @@ -30,10 +30,10 @@ jobs: - name: Lint run: | - pnpm run lint:web + pnpm run lint:cli - name: Test run: | - pnpm run test:web + pnpm run test:cli - \ No newline at end of file + From 2db196f341ad559a35db5c17098e3fa3a91e5767 Mon Sep 17 00:00:00 2001 From: Harsh Patel Date: Fri, 29 Dec 2023 23:12:50 +0530 Subject: [PATCH 4/6] build: pnpm cache setup * this will make the pnpm install way faster. (hopefully) --- .github/workflows/api.yaml | 13 +++++++++++++ .github/workflows/cli.yaml | 13 +++++++++++++ .github/workflows/sdk-node.yaml | 13 +++++++++++++ .github/workflows/web.yaml | 13 +++++++++++++ 4 files changed, 52 insertions(+) diff --git a/.github/workflows/api.yaml b/.github/workflows/api.yaml index 9e48ac2a..45af1223 100644 --- a/.github/workflows/api.yaml +++ b/.github/workflows/api.yaml @@ -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: | diff --git a/.github/workflows/cli.yaml b/.github/workflows/cli.yaml index 1569a056..a074572b 100644 --- a/.github/workflows/cli.yaml +++ b/.github/workflows/cli.yaml @@ -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 diff --git a/.github/workflows/sdk-node.yaml b/.github/workflows/sdk-node.yaml index 6790d773..090ed492 100644 --- a/.github/workflows/sdk-node.yaml +++ b/.github/workflows/sdk-node.yaml @@ -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 diff --git a/.github/workflows/web.yaml b/.github/workflows/web.yaml index ba9412f8..1f3ce74d 100644 --- a/.github/workflows/web.yaml +++ b/.github/workflows/web.yaml @@ -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 From 8212d591df508605d011ce0ad7e4c14162351d16 Mon Sep 17 00:00:00 2001 From: Harsh Patel Date: Fri, 29 Dec 2023 23:20:36 +0530 Subject: [PATCH 5/6] fix: indendation errors * Fix indentation in workflow file --- .github/workflows/api.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/api.yaml b/.github/workflows/api.yaml index 45af1223..5f5946ac 100644 --- a/.github/workflows/api.yaml +++ b/.github/workflows/api.yaml @@ -37,7 +37,7 @@ jobs: restore-keys: | ${{ runner.os }}-pnpm-store- - - name: Install packages + - name: Install packages run: | pnpm i @@ -45,6 +45,6 @@ jobs: run: | pnpm run lint:api - - name: Test + - name: Test run: | pnpm run test:api From 0da0953fa0aa2c7295e1ed6652684c1395434631 Mon Sep 17 00:00:00 2001 From: Harsh Patel Date: Fri, 29 Dec 2023 23:35:20 +0530 Subject: [PATCH 6/6] chore: remove / for consistancy --- .github/workflows/sdk-node.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sdk-node.yaml b/.github/workflows/sdk-node.yaml index 090ed492..27716230 100644 --- a/.github/workflows/sdk-node.yaml +++ b/.github/workflows/sdk-node.yaml @@ -1,6 +1,6 @@ on: push: - paths: ['/packages/sdk-node/**', '.github/workflows/sdk-node.yaml'] + paths: ['packages/sdk-node/**', '.github/workflows/sdk-node.yaml'] pull_request: paths: ['packages/sdk-node']