Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .github/workflows/lint-test-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,25 @@ on:
paths:
- '**/*'

workflow_dispatch:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ™Œ


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
env:
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
CI: true
SDK_BRANCH_NAME: ${{ inputs.sdk_branch || github.head_ref || github.ref_name || 'main' }}
TEST_DATA_BRANCH_NAME: ${{ inputs.test_data_branch || 'main' }}

jobs:
lint-test-sdk:
Expand All @@ -17,8 +32,15 @@ jobs:
matrix:
java-version: ['8', '11', '17'] # Define the Java versions to test against
steps:
- name: Display Testing Details
run: |
echo "Running SDK Test using"
echo "Test Data: sdk-test-data@${TEST_DATA_BRANCH_NAME}"
echo "SDK Branch: php-sdk@${SDK_BRANCH_NAME}"
- uses: actions/checkout@v4
with:
repository: Eppo-exp/java-server-sdk
ref: ${{ env.SDK_BRANCH_NAME }}
fetch-depth: 0

- name: Set up JDK ${{ matrix.java-version }}
Expand All @@ -28,4 +50,4 @@ jobs:
distribution: 'adopt'

- name: Run tests
run: make test-data && ./gradlew check --no-daemon --stacktrace
run: make test-data branchName=${{ env.TEST_DATA_BRANCH_NAME }} && ./gradlew check --no-daemon --stacktrace
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to adjust our makefile to support this? Would branchName get overriden with main when it's set in the makefile?

## test-data
testDataDir := src/test/resources/shared
tempDir := ${testDataDir}/temp
gitDataDir := ${tempDir}/sdk-test-data
branchName := main
githubRepoLink := https://github.com/Eppo-exp/sdk-test-data.git
.PHONY: test-data
test-data:
	rm -rf $(testDataDir)
	mkdir -p ${tempDir}
	git clone -b ${branchName} --depth 1 --single-branch ${githubRepoLink} ${gitDataDir}
	cp -r ${gitDataDir}/ufc ${testDataDir}
	rm ${testDataDir}/ufc/bandit-tests/*.dynamic-typing.json
	rm -rf ${tempDir}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I've learned more about makefiles and passing it in will indeed override πŸ‘Œ

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I, too, learned about this nifty feature of Makefiles when I set about this work and really appreciate how easy using Makefiles across the SDKs has made this work!