-
Notifications
You must be signed in to change notification settings - Fork 4
quality: parameterize SDK and test-data branches #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,48 @@ | ||
name: Swift | ||
|
||
on: [push] | ||
env: | ||
SDK_BRANCH_NAME: ${{ inputs.sdk_branch || github.head_ref || github.ref_name }} | ||
TEST_DATA_BRANCH_NAME: ${{ inputs.test_data_branch || 'main' }} | ||
|
||
on: | ||
push: | ||
|
||
pull_request: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need to include There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe so. |
||
|
||
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: | ||
build: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: 'Set up Cloud SDK' | ||
uses: 'google-github-actions/setup-gcloud@v1' | ||
- name: Display Testing Details | ||
run: | | ||
echo "Running SDK Test using" | ||
echo "Test Data: sdk-test-data@${TEST_DATA_BRANCH_NAME}" | ||
echo "SDK Branch: eppo-ios-sdk@${SDK_BRANCH_NAME}" | ||
- name: 'Use gcloud CLI' | ||
run: 'gcloud info' | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: Eppo-exp/eppo-ios-sdk | ||
ref: ${{ env.SDK_BRANCH_NAME}} | ||
|
||
- name: Build | ||
run: make build | ||
|
||
- name: Pull test data | ||
run: make test-data | ||
run: make test-data branchName=${{env.TEST_DATA_BRANCH_NAME}} | ||
|
||
- name: Run tests | ||
run: make test |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ build: | |
swift build | ||
|
||
.PHONY: test | ||
test: | ||
test: | ||
swift test | ||
|
||
## test-data | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be restricted to
main
branch?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a change in syntax to accommodate multiple triggers. That being said, there's not a lot of consistency across the SDKs here on this, so let's set the bar here.
We want tests to run when a) push to main, b) PR opened, c) PR updated
So, you are right that we can restrict push to branches: main as
pull_request
includes thesynchronize
event which is triggered by pushing commits to a branch under a PR.