From 6e87bbf2f81faf5d8efefb501f134bdad82d9319 Mon Sep 17 00:00:00 2001 From: Ty Potter Date: Wed, 28 Aug 2024 22:48:08 -0600 Subject: [PATCH 1/3] parameterize sdk and test data branch --- .github/workflows/ci.yml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index acecdd8..a96c808 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,9 @@ name: CI + +env: + SDK_BRANCH_NAME: ${{ inputs.sdk_branch || github.head_ref || github.ref_name || 'main' }} + TEST_DATA_BRANCH_NAME: ${{ inputs.test_data_branch || 'main' }} + on: push: branches: @@ -6,13 +11,29 @@ on: pull_request: branches: - main + 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 + jobs: lint: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 + with: + repository: Eppo-exp/react-native-sdk + ref: ${{ env.SDK_BRANCH_NAME}} - name: Setup Node.js uses: actions/setup-node@v3 @@ -33,6 +54,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + repository: Eppo-exp/react-native-sdk + ref: ${{ env.SDK_BRANCH_NAME}} - name: Setup Node.js uses: actions/setup-node@v3 @@ -46,13 +70,16 @@ jobs: run: yarn install - name: Run unit tests - run: yarn test --maxWorkers=2 --coverage + run: make test branchName=${{env.TEST_DATA_BRANCH_NAME}} build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 + with: + repository: Eppo-exp/react-native-sdk + ref: ${{ env.SDK_BRANCH_NAME}} - name: Setup Node.js uses: actions/setup-node@v3 From 2cb2602fd88446b2cb5e7227c10d83a3566beaa0 Mon Sep 17 00:00:00 2001 From: Ty Potter Date: Thu, 29 Aug 2024 08:29:31 -0600 Subject: [PATCH 2/3] make test --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 960d470..88b4e2a 100644 --- a/Makefile +++ b/Makefile @@ -37,3 +37,7 @@ test-data: cp ${gitDataDir}rac-experiments-v3.json ${testDataDir} cp -r ${gitDataDir}assignment-v2 ${testDataDir} rm -rf ${tempDir} + +.PHONY: test +test: test-data + yarn test --maxWorkers=2 --coverage \ No newline at end of file From ba6f2aa4f390a4b1327e4180f7429a006b8f1643 Mon Sep 17 00:00:00 2001 From: Ty Potter Date: Thu, 29 Aug 2024 09:12:01 -0600 Subject: [PATCH 3/3] echo details --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a96c808..a8b9a71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,14 @@ jobs: test: 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: php-sdk@${SDK_BRANCH_NAME}" + - name: Checkout uses: actions/checkout@v3 with: