Skip to content

Commit e260758

Browse files
authored
quality: parameterize sdk and test data branch (#58)
* parameterize sdk and test data branch
1 parent 5bc5993 commit e260758

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,39 @@
11
name: CI
2+
3+
env:
4+
SDK_BRANCH_NAME: ${{ inputs.sdk_branch || github.head_ref || github.ref_name || 'main' }}
5+
TEST_DATA_BRANCH_NAME: ${{ inputs.test_data_branch || 'main' }}
6+
27
on:
38
push:
49
branches:
510
- main
611
pull_request:
712
branches:
813
- main
14+
workflow_dispatch:
915

16+
workflow_call:
17+
inputs:
18+
test_data_branch:
19+
type: string
20+
description: The branch in sdk-test-data to target for testcase files
21+
required: false
22+
default: main
23+
sdk_branch:
24+
type: string
25+
description: The branch of the SDK to test
26+
required: false
27+
1028
jobs:
1129
lint:
1230
runs-on: ubuntu-latest
1331
steps:
1432
- name: Checkout
1533
uses: actions/checkout@v3
34+
with:
35+
repository: Eppo-exp/react-native-sdk
36+
ref: ${{ env.SDK_BRANCH_NAME}}
1637

1738
- name: Setup Node.js
1839
uses: actions/setup-node@v3
@@ -30,9 +51,19 @@ jobs:
3051

3152
test:
3253
runs-on: ubuntu-latest
54+
3355
steps:
56+
- name: Display Testing Details
57+
run: |
58+
echo "Running SDK Test using"
59+
echo "Test Data: sdk-test-data@${TEST_DATA_BRANCH_NAME}"
60+
echo "SDK Branch: php-sdk@${SDK_BRANCH_NAME}"
61+
3462
- name: Checkout
3563
uses: actions/checkout@v3
64+
with:
65+
repository: Eppo-exp/react-native-sdk
66+
ref: ${{ env.SDK_BRANCH_NAME}}
3667

3768
- name: Setup Node.js
3869
uses: actions/setup-node@v3
@@ -46,13 +77,16 @@ jobs:
4677
run: yarn install
4778

4879
- name: Run unit tests
49-
run: yarn test --maxWorkers=2 --coverage
80+
run: make test branchName=${{env.TEST_DATA_BRANCH_NAME}}
5081

5182
build:
5283
runs-on: ubuntu-latest
5384
steps:
5485
- name: Checkout
5586
uses: actions/checkout@v3
87+
with:
88+
repository: Eppo-exp/react-native-sdk
89+
ref: ${{ env.SDK_BRANCH_NAME}}
5690

5791
- name: Setup Node.js
5892
uses: actions/setup-node@v3

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ test-data:
3737
cp ${gitDataDir}rac-experiments-v3.json ${testDataDir}
3838
cp -r ${gitDataDir}assignment-v2 ${testDataDir}
3939
rm -rf ${tempDir}
40+
41+
.PHONY: test
42+
test: test-data
43+
yarn test --maxWorkers=2 --coverage

0 commit comments

Comments
 (0)