From 5552b20b4ecfe07b6ab9112dbe57166cb3e3097e Mon Sep 17 00:00:00 2001 From: Wanpeng Li Date: Mon, 17 Jun 2024 14:06:56 +0800 Subject: [PATCH 1/4] add github action --- ...js-sdk-release-tool-pull-request-check.yml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/js-sdk-release-tool-pull-request-check.yml diff --git a/.github/workflows/js-sdk-release-tool-pull-request-check.yml b/.github/workflows/js-sdk-release-tool-pull-request-check.yml new file mode 100644 index 000000000..741b465dc --- /dev/null +++ b/.github/workflows/js-sdk-release-tool-pull-request-check.yml @@ -0,0 +1,24 @@ +name: Javascript SDK Release Tool Pull Request Check + +on: + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + name: Build and Test TypeScript + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install dependencies + run: npm install + + - name: Build TypeScript + run: npm run build + + - name: Run Unit Tests + run: npm run test \ No newline at end of file From e77532e430b48bc9fdff620d213f951858a6f92c Mon Sep 17 00:00:00 2001 From: Wanpeng Li Date: Mon, 17 Jun 2024 14:12:50 +0800 Subject: [PATCH 2/4] fix working dir --- .github/workflows/js-sdk-release-tool-pull-request-check.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/js-sdk-release-tool-pull-request-check.yml b/.github/workflows/js-sdk-release-tool-pull-request-check.yml index 741b465dc..0a82629c6 100644 --- a/.github/workflows/js-sdk-release-tool-pull-request-check.yml +++ b/.github/workflows/js-sdk-release-tool-pull-request-check.yml @@ -16,9 +16,12 @@ jobs: - name: Install dependencies run: npm install + working-directory: ./tools/js-sdk-release-tools/ - name: Build TypeScript run: npm run build + working-directory: ./tools/js-sdk-release-tools/ - name: Run Unit Tests - run: npm run test \ No newline at end of file + run: npm run test + working-directory: ./tools/js-sdk-release-tools/ From 332ac5e0ba518bd57d4592ea5899a4168c78929e Mon Sep 17 00:00:00 2001 From: Wanpeng Li Date: Mon, 17 Jun 2024 15:32:17 +0800 Subject: [PATCH 3/4] add to workflow --- .github/workflows/js-sdk-release-tool-pull-request-check.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/js-sdk-release-tool-pull-request-check.yml b/.github/workflows/js-sdk-release-tool-pull-request-check.yml index 0a82629c6..2516a91af 100644 --- a/.github/workflows/js-sdk-release-tool-pull-request-check.yml +++ b/.github/workflows/js-sdk-release-tool-pull-request-check.yml @@ -25,3 +25,7 @@ jobs: - name: Run Unit Tests run: npm run test working-directory: ./tools/js-sdk-release-tools/ + + - name: Run CI E2E Tests + run: npm run test:ci + working-directory: ./tools/js-sdk-release-tools/ From b56e3c615363f18b20cd44dd0e63ecfb6f40a71f Mon Sep 17 00:00:00 2001 From: Wanpeng Li Date: Wed, 19 Jun 2024 14:26:12 +0800 Subject: [PATCH 4/4] limit to run actual test in tool repo --- .../js-sdk-release-tool-pull-request-check.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/js-sdk-release-tool-pull-request-check.yml b/.github/workflows/js-sdk-release-tool-pull-request-check.yml index 2516a91af..2bdf21ae7 100644 --- a/.github/workflows/js-sdk-release-tool-pull-request-check.yml +++ b/.github/workflows/js-sdk-release-tool-pull-request-check.yml @@ -14,18 +14,28 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + - name: Check file existence + id: check_files + uses: andstor/file-existence-action@v1 + with: + files: "tools/js-sdk-release-tools/package.json" + - name: Install dependencies + if: steps.check_files.outputs.files_exists == 'true' run: npm install - working-directory: ./tools/js-sdk-release-tools/ + working-directory: tools/js-sdk-release-tools/ - name: Build TypeScript + if: steps.check_files.outputs.files_exists == 'true' run: npm run build - working-directory: ./tools/js-sdk-release-tools/ + working-directory: tools/js-sdk-release-tools/ - name: Run Unit Tests + if: steps.check_files.outputs.files_exists == 'true' run: npm run test - working-directory: ./tools/js-sdk-release-tools/ + working-directory: tools/js-sdk-release-tools/ - name: Run CI E2E Tests + if: steps.check_files.outputs.files_exists == 'true' run: npm run test:ci - working-directory: ./tools/js-sdk-release-tools/ + working-directory: tools/js-sdk-release-tools/