Skip to content

Commit 1702711

Browse files
authored
quality: parameterize branch names and make test (#96)
* parameterize branch names and make test * gcloud no longer used for downloading test data
1 parent 6e51efd commit 1702711

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

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

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,37 @@ on:
44
paths:
55
- '**/*'
66

7+
workflow_dispatch:
8+
9+
workflow_call:
10+
inputs:
11+
test_data_branch:
12+
type: string
13+
description: The branch in sdk-test-data to target for testcase files
14+
required: false
15+
default: main
16+
sdk_branch:
17+
type: string
18+
description: The branch of the SDK to test
19+
required: false
20+
21+
env:
22+
SDK_BRANCH_NAME: ${{ inputs.sdk_branch || github.head_ref || github.ref_name || 'main' }}
23+
TEST_DATA_BRANCH_NAME: ${{ inputs.test_data_branch || 'main' }}
24+
725
jobs:
826
lint-test-sdk:
927
runs-on: ubuntu-latest
1028
steps:
29+
- name: Display Testing Details
30+
run: |
31+
echo "Running SDK Test using"
32+
echo "Test Data: sdk-test-data@${TEST_DATA_BRANCH_NAME}"
33+
echo "SDK Branch: js-client-sdk@${SDK_BRANCH_NAME}"
1134
- uses: actions/checkout@v2
35+
with:
36+
repository: Eppo-exp/js-client-sdk
37+
ref: ${{ env.SDK_BRANCH_NAME }}
1238
- name: Use Node.js
1339
uses: actions/setup-node@v1
1440
with:
@@ -17,21 +43,22 @@ jobs:
1743
with:
1844
path: './node_modules'
1945
key: ${{ runner.os }}-root-node-modules-${{ hashFiles('./yarn.lock') }}
20-
- name: 'Set up GCP SDK for downloading test data'
21-
uses: 'google-github-actions/setup-gcloud@v0'
2246
- name: Install SDK dependencies
2347
run: yarn --frozen-lockfile
2448
working-directory: ./
2549
- name: Check code with eslint
2650
run: npx eslint '**/*.{ts,tsx}'
2751
working-directory: ./
2852
- name: Run tests
29-
run: yarn test
53+
run: make test branchName=${{ env.TEST_DATA_BRANCH_NAME }}
3054
working-directory: ./
3155
typecheck:
3256
runs-on: ubuntu-latest
3357
steps:
3458
- uses: actions/checkout@v2
59+
with:
60+
repository: Eppo-exp/js-client-sdk
61+
ref: ${{ env.SDK_BRANCH_NAME }}
3562
- name: Use Node.js
3663
uses: actions/setup-node@v1
3764
with:

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,8 @@ prepare: test-data
4545
yarn tsc
4646
yarn webpack
4747
yarn api-extractor run --local
48+
49+
## test
50+
.PHONY: test
51+
test: test test-data
52+
yarn test:unit

0 commit comments

Comments
 (0)