Skip to content

Commit 5afce90

Browse files
authored
quality: parameterize SDK and test-data branches (#40)
* parameterize SDK and test-data branches * limit on push to main
1 parent d219951 commit 5afce90

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

.github/workflows/unit-tests.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,49 @@
11
name: Swift
22

3-
on: [push]
3+
env:
4+
SDK_BRANCH_NAME: ${{ inputs.sdk_branch || github.head_ref || github.ref_name }}
5+
TEST_DATA_BRANCH_NAME: ${{ inputs.test_data_branch || 'main' }}
6+
7+
on:
8+
push:
9+
branches: [main]
10+
11+
pull_request:
12+
13+
workflow_dispatch:
14+
15+
workflow_call:
16+
inputs:
17+
test_data_branch:
18+
type: string
19+
description: The branch in sdk-test-data to target for testcase files
20+
required: false
21+
default: main
22+
sdk_branch:
23+
type: string
24+
description: The branch of the SDK to test
25+
required: false
426

527
jobs:
628
build:
729
runs-on: macos-latest
830
steps:
9-
- uses: actions/checkout@v3
10-
- name: 'Set up Cloud SDK'
11-
uses: 'google-github-actions/setup-gcloud@v1'
31+
- name: Display Testing Details
32+
run: |
33+
echo "Running SDK Test using"
34+
echo "Test Data: sdk-test-data@${TEST_DATA_BRANCH_NAME}"
35+
echo "SDK Branch: eppo-ios-sdk@${SDK_BRANCH_NAME}"
1236
13-
- name: 'Use gcloud CLI'
14-
run: 'gcloud info'
37+
- uses: actions/checkout@v3
38+
with:
39+
repository: Eppo-exp/eppo-ios-sdk
40+
ref: ${{ env.SDK_BRANCH_NAME}}
1541

1642
- name: Build
1743
run: make build
1844

1945
- name: Pull test data
20-
run: make test-data
46+
run: make test-data branchName=${{env.TEST_DATA_BRANCH_NAME}}
2147

2248
- name: Run tests
2349
run: make test

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ build:
2929
swift build
3030

3131
.PHONY: test
32-
test:
32+
test:
3333
swift test
3434

3535
## test-data

0 commit comments

Comments
 (0)