diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 9b1d801..642b21e 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -1,23 +1,49 @@ 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: + branches: [main] + + pull_request: + + 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 diff --git a/Makefile b/Makefile index cdc292f..3aeaa00 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ build: swift build .PHONY: test -test: +test: swift test ## test-data