Skip to content

Commit bb2ea71

Browse files
authored
Quality: Parameterize SDK and test-data branches (#69)
1 parent 9bd8b6b commit bb2ea71

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

.github/workflows/lint-test-sdk.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
11
name: Lint and Test SDK
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
pull_request:
4-
path: '**/*'
5-
9+
branches: [ "*" ]
10+
workflow_dispatch:
11+
workflow_call:
12+
inputs:
13+
test_data_branch:
14+
type: string
15+
description: The branch in sdk-test-data to target for testcase files
16+
required: false
17+
default: main
18+
sdk_branch:
19+
type: string
20+
description: The branch of the SDK to test
21+
required: false
22+
623
jobs:
724
lint-test-sdk:
825
runs-on: ubuntu-latest
926
steps:
1027
- uses: actions/checkout@v2
28+
with:
29+
repository: Eppo-exp/node-server-sdk
30+
ref: ${{ env.SDK_BRANCH_NAME }}
1131
- name: Use Node.js
1232
uses: actions/setup-node@v1
1333
with:
@@ -19,21 +39,22 @@ jobs:
1939
- name: Install root dependencies
2040
run: yarn --frozen-lockfile
2141
working-directory: ./
22-
- name: 'Set up GCP SDK for downloading test data'
23-
uses: 'google-github-actions/setup-gcloud@v0'
2442
- name: Install sdk dependencies
2543
run: yarn --frozen-lockfile
2644
working-directory: ./
2745
- name: Check code with eslint
2846
run: npx eslint '**/*.{ts,tsx}'
2947
working-directory: ./
30-
- name: Run unit tests
31-
run: yarn test:unit
48+
- name: Run unit and e2e tests
49+
run: make test branchName=${{ env.TEST_DATA_BRANCH_NAME }}
3250
working-directory: ./
3351
typecheck:
3452
runs-on: ubuntu-latest
3553
steps:
3654
- uses: actions/checkout@v2
55+
with:
56+
repository: Eppo-exp/node-server-sdk
57+
ref: ${{ env.SDK_BRANCH_NAME }}
3758
- name: Use Node.js
3859
uses: actions/setup-node@v1
3960
with:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ test-data:
3939

4040
## test
4141
.PHONY: test
42-
test: test
42+
test: test test-data
4343
yarn test:unit
4444

4545
## prepare

0 commit comments

Comments
 (0)