Skip to content
Draft
Show file tree
Hide file tree
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
33 changes: 24 additions & 9 deletions .github/workflows/test-sdk-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,52 @@ on:
workflow_dispatch:

jobs:
test-dart-sdk:
strategy:
fail-fast: false
matrix:
platform: ["linux"]
uses: ./.github/workflows/test-server-sdk.yml
with:
platform: ${{ matrix.platform }}
sdkName: "eppo/dart-sdk"
sdkRelayDir: "dart-sdk-relay"
setupAction: "dart-lang/setup-dart@v1"
setupWith: '{"sdk": "stable"}'
secrets: inherit

test-php-sdk:
strategy:
fail-fast: false
matrix:
platform: ['linux']
platform: ["linux"]
uses: ./.github/workflows/test-server-sdk.yml
with:
platform: ${{ matrix.platform }}
sdkName: 'eppo/php-sdk'
sdkRelayDir: 'php-sdk-relay'
sdkName: "eppo/php-sdk"
sdkRelayDir: "php-sdk-relay"
secrets: inherit

test-python-sdk:
strategy:
fail-fast: false
matrix:
platform: ['linux']
platform: ["linux"]
uses: ./.github/workflows/test-server-sdk.yml
with:
platform: ${{ matrix.platform }}
sdkName: 'eppo/python-sdk'
sdkRelayDir: 'python-sdk-relay'
sdkName: "eppo/python-sdk"
sdkRelayDir: "python-sdk-relay"
secrets: inherit

test-node-sdk:
strategy:
fail-fast: false
matrix: ['linux']
matrix:
platform: ["linux"]
Comment on lines +52 to +53
Copy link
Member Author

Choose a reason for hiding this comment

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

not valid yaml format

[Invalid workflow file: .github/workflows/test-sdk-packages.yml#L50](https://github.com/Eppo-exp/sdk-test-data/actions/runs/13536314793/workflow)
The workflow is not valid. .github/workflows/test-sdk-packages.yml (Line: 50, Col: 15): A sequence was not expected

uses: ./.github/workflows/test-server-sdk.yml
with:
platform: ${{ matrix.platform }}
sdkName: 'eppo/node-server-sdk'
sdkRelayDir: 'node-sdk-relay'
sdkName: "eppo/node-server-sdk"
sdkRelayDir: "node-sdk-relay"
secrets: inherit
150 changes: 82 additions & 68 deletions .github/workflows/test-server-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,28 @@ on:
workflow_call:
inputs:
platform:
description: 'Platforms to test the SDK Relay on; linux, macos, windows'
description: "Platforms to test the SDK Relay on; linux, macos, windows"
type: string
required: true
sdkName:
description: 'Name of the SDK'
description: "Name of the SDK"
type: string
required: true
sdkRelayDir:
description: 'Directory of the SDK Relay server code'
description: "Directory of the SDK Relay server code"
type: string
required: false
os:
description: 'Specific runner OS to use'
description: "Specific runner OS to use"
type: string

setupAction:
description: "Optional GitHub action to run for setup (e.g., dart-lang/setup-dart@v1)"
type: string
required: false
setupWith:
description: "Optional JSON string of parameters to pass to the setup action"
type: string
required: false

jobs:
test-packaged-server-sdks:
Expand All @@ -37,66 +44,73 @@ jobs:
GAR_LOCATION: ${{ vars.SDK_TESTING_REGION }}-docker.pkg.dev/${{ vars.SDK_TESTING_PROJECT_ID }}/sdk-testing

steps:
- name: Test information header
shell: bash
run: echo "Running Test Cluster for ${SDK_NAME}"

- name: Set some variables
id: vars
run: |
echo "::set-output name=date::$(date +'%Y-%m-%d')"
echo "SAFE_SDK_NAME=$(echo ${SDK_NAME} | sed 's/\//_/g')" >> $GITHUB_ENV


- name: "Checkout"
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

# Set up docker (macos runners)
- id: setup-docker
if: ${{ inputs.platform == 'macos' }}
name: Setup Docker
uses: douglascamata/setup-docker-macos-action@v1-alpha

# Set up gCloud
- id: "auth"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.SERVICE_ACCOUNT_KEY }}"

- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v1"

# Allow docker access to the GAR
- name: "Docker auth"
run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet

# Pull test runner and testing api images for GCP Artifact Registry (GAR) and
# retag them locally as expected by the runner script.
- name: Pull Test Runner image
run: |
docker pull ${{ env.GAR_LOCATION }}/sdk-test-runner:latest
docker tag ${{ env.GAR_LOCATION }}/sdk-test-runner:latest Eppo-exp/sdk-test-runner:latest
docker pull ${{ env.GAR_LOCATION }}/testing-api:latest
docker tag ${{ env.GAR_LOCATION }}/testing-api:latest Eppo-exp/testing-api:latest

- name: Run tests
run: |
pushd package-testing/sdk-test-runner
./test-sdk.sh server ${SDK_NAME}
popd

- name: Upload Logs
if: success() || failure() # always run even if the previous steps fail

uses: actions/upload-artifact@v4
with:
name: ${{ steps.date.outputs.date }}-${{ env.SAFE_SDK_NAME }}-${{ inputs.platform }}-test-logs
path: package-testing/sdk-test-runner/logs/

- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: success() || failure() # always run even if the previous steps fail
with:
report_paths: 'package-testing/sdk-test-runner/logs/results.xml'
- name: Test information header
shell: bash
run: echo "Running Test Cluster for ${SDK_NAME}"

- name: Set some variables
id: vars
run: |
echo "::set-output name=date::$(date +'%Y-%m-%d')"
echo "SAFE_SDK_NAME=$(echo ${SDK_NAME} | sed 's/\//_/g')" >> $GITHUB_ENV

- name: "Checkout"
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

# Optional setup action
- name: "Run setup action"
if: ${{ inputs.setupAction != '' }}
uses: jenseng/dynamic-uses@v1
with:
uses: ${{ inputs.setupAction }}
with: ${{ inputs.setupWith || '{}' }}

# Set up docker (macos runners)
- id: setup-docker
if: ${{ inputs.platform == 'macos' }}
name: Setup Docker
uses: douglascamata/setup-docker-macos-action@v1-alpha

# Set up gCloud
- id: "auth"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.SERVICE_ACCOUNT_KEY }}"

- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v1"

# Allow docker access to the GAR
- name: "Docker auth"
run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet

# Pull test runner and testing api images for GCP Artifact Registry (GAR) and
# retag them locally as expected by the runner script.
- name: Pull Test Runner image
run: |
docker pull ${{ env.GAR_LOCATION }}/sdk-test-runner:latest
docker tag ${{ env.GAR_LOCATION }}/sdk-test-runner:latest Eppo-exp/sdk-test-runner:latest
docker pull ${{ env.GAR_LOCATION }}/testing-api:latest
docker tag ${{ env.GAR_LOCATION }}/testing-api:latest Eppo-exp/testing-api:latest

- name: Run tests
run: |
pushd package-testing/sdk-test-runner
./test-sdk.sh server ${SDK_NAME}
popd

- name: Upload Logs
if: success() || failure() # always run even if the previous steps fail

uses: actions/upload-artifact@v4
with:
name: ${{ steps.date.outputs.date }}-${{ env.SAFE_SDK_NAME }}-${{ inputs.platform }}-test-logs
path: package-testing/sdk-test-runner/logs/

- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: success() || failure() # always run even if the previous steps fail
with:
report_paths: "package-testing/sdk-test-runner/logs/results.xml"
4 changes: 4 additions & 0 deletions package-testing/dart-sdk-relay/.env.EXAMPLE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SDK_RELAY_PORT=4000
EPPO_BASE_URL=http://localhost:5000/api
EPPO_API_KEY=NOKEYSPECIFIED
SDK_REF=main
6 changes: 6 additions & 0 deletions package-testing/dart-sdk-relay/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.env
.dart_tool/
.packages
pubspec.lock
vendor/
lib/native/
Loading