From 387b204baf684a5fb4e127490f7b26a3bead001b Mon Sep 17 00:00:00 2001 From: Ty Potter Date: Tue, 20 Aug 2024 22:21:01 -0600 Subject: [PATCH 1/2] parameterize branch names and make test --- .github/workflows/lint-test-sdk.yml | 31 ++++++++++++++++++++++++++++- Makefile | 5 +++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint-test-sdk.yml b/.github/workflows/lint-test-sdk.yml index a097dec..caa9347 100644 --- a/.github/workflows/lint-test-sdk.yml +++ b/.github/workflows/lint-test-sdk.yml @@ -4,11 +4,37 @@ on: paths: - '**/*' + workflow_dispatch: + + workflow_call: + inputs: + test_data_branch: + type: string + description: The branch in sdk-test-data to target for testcase files + required: false + default: main + sdk_branch: + type: string + description: The branch of the SDK to test + required: false + +env: + SDK_BRANCH_NAME: ${{ inputs.sdk_branch || github.head_ref || github.ref_name || 'main' }} + TEST_DATA_BRANCH_NAME: ${{ inputs.test_data_branch || 'main' }} + jobs: lint-test-sdk: runs-on: ubuntu-latest steps: + - name: Display Testing Details + run: | + echo "Running SDK Test using" + echo "Test Data: sdk-test-data@${TEST_DATA_BRANCH_NAME}" + echo "SDK Branch: js-client-sdk@${SDK_BRANCH_NAME}" - uses: actions/checkout@v2 + with: + repository: Eppo-exp/js-client-sdk + ref: ${{ env.SDK_BRANCH_NAME }} - name: Use Node.js uses: actions/setup-node@v1 with: @@ -26,12 +52,15 @@ jobs: run: npx eslint '**/*.{ts,tsx}' working-directory: ./ - name: Run tests - run: yarn test + run: make test branchName=${{ env.TEST_DATA_BRANCH_NAME }} working-directory: ./ typecheck: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + repository: Eppo-exp/js-client-sdk + ref: ${{ env.SDK_BRANCH_NAME }} - name: Use Node.js uses: actions/setup-node@v1 with: diff --git a/Makefile b/Makefile index c77f1ef..c23789b 100644 --- a/Makefile +++ b/Makefile @@ -45,3 +45,8 @@ prepare: test-data yarn tsc yarn webpack yarn api-extractor run --local + +## test +.PHONY: test +test: test test-data + yarn test:unit \ No newline at end of file From f03e2127f281fa5aef28fdff88f324c565ebccfa Mon Sep 17 00:00:00 2001 From: Ty Potter Date: Wed, 21 Aug 2024 08:47:13 -0600 Subject: [PATCH 2/2] gcloud no longer used for downloading test data --- .github/workflows/lint-test-sdk.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/lint-test-sdk.yml b/.github/workflows/lint-test-sdk.yml index caa9347..364424e 100644 --- a/.github/workflows/lint-test-sdk.yml +++ b/.github/workflows/lint-test-sdk.yml @@ -43,8 +43,6 @@ jobs: with: path: './node_modules' key: ${{ runner.os }}-root-node-modules-${{ hashFiles('./yarn.lock') }} - - name: 'Set up GCP SDK for downloading test data' - uses: 'google-github-actions/setup-gcloud@v0' - name: Install SDK dependencies run: yarn --frozen-lockfile working-directory: ./