Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
typotter committed Jan 23, 2025
2 parents 2165857 + 9504d98 commit 8412783
Show file tree
Hide file tree
Showing 90 changed files with 11,569 additions and 203 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build and push SDK Test Runner

on:
workflow_call:
inputs:
version:
description: 'Version string for SDK Test Runner release'
type: string
required: true
docker_context:
type: string
description: 'Directory where dockerfile exists'
required: true
image_name:
type: string
description: 'Docker image name'
required: true

env:
VERSION: 1.1.0

PROJECT_ID: ${{ vars.SDK_TESTING_PROJECT_ID }}
REGION: ${{ vars.SDK_TESTING_REGION }}
GAR_LOCATION: ${{ vars.SDK_TESTING_REGION }}-docker.pkg.dev/${{ vars.SDK_TESTING_PROJECT_ID }}/sdk-testing


jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3

# 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"

- name: "Use gcloud CLI"
run: "gcloud info"

# Allow docker access to the GAR
- name: "Docker auth"
run: |-
gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet
# Build and push
- name: Build and export
uses: docker/build-push-action@v6
with:
push: true
context: ${{ inputs.docker_context }}
tags: ${{ env.GAR_LOCATION }}/${{ inputs.image_name }}:latest,${{ env.GAR_LOCATION }}/${{ inputs.image_name }}:${{ env.VERSION }}
22 changes: 22 additions & 0 deletions .github/workflows/release-sdk-test-runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build and push SDK Test Runner

on:
workflow_dispatch:
inputs:
version:
description: 'Version string for SDK Test Runner release'
required: true
default: '1.0.0'

push:
paths:
.github/workflows/release-sdk-test-runner.yml

jobs:
build-and-upload:
uses: ./.github/workflows/build-and-push.yml
with:
version: ${{ inputs.version }}
docker_context: ./package-testing/sdk-test-runner
image_name: sdk-test-runner
secrets: inherit
22 changes: 22 additions & 0 deletions .github/workflows/release-sdk-testing-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build and push Testing API

on:
workflow_dispatch:
inputs:
version:
description: 'Version string for SDK Testing API release'
required: true
default: '1.0.0'

push:
paths:
.github/workflows/release-sdk-testing-api.yml

jobs:
build-and-upload:
uses: ./.github/workflows/build-and-push.yml
with:
version: ${{ inputs.version }}
docker_context: ./package-testing/testing-api
image_name: testing-api
secrets: inherit
33 changes: 33 additions & 0 deletions .github/workflows/test-sdk-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test Packaged SDKs

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

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

test-python-sdk:
strategy:
fail-fast: false
matrix:
platform: ['linux']
uses: ./.github/workflows/test-server-sdk.yml
with:
platform: ${{ matrix.platform }}
sdkName: 'eppo/python-sdk'
sdkRelayDir: 'python-sdk-relay'
secrets: inherit
9 changes: 6 additions & 3 deletions .github/workflows/test-sdks-remote.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Test SDKs Remotely
# Triggers testing workflows in all SDK repositories except eppo-multiplatform
# For eppo-multiplatform, Depndabot does the job of the remote-testing by opening a PR against the repo to update test data.

on:
push:
branches:
- main
paths:
- 'ufc/**'
- '.github/workflows/test-sdks-remote.yml'
workflow_dispatch:

jobs:
Expand All @@ -14,23 +17,23 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
matrix:
sdk:
- { repo: "android-sdk", workflow: "test.yaml", ref: "main" }
- { repo: "dot-net-server-sdk", workflow: "run-tests.yml", ref: "main" }
- { repo: "eppo-ios-sdk", workflow: "unit-tests.yml", ref: "main" }
- { repo: "golang-sdk", workflow: "test.yml", ref: "main" }
- { repo: "sdk-common-jdk", workflow: "lint-test-sdk.yml", ref: "main" }
- { repo: "java-server-sdk", workflow: "lint-test-sdk.yml", ref: "main" }
- { repo: "js-client-sdk", workflow: "lint-test-sdk.yml", ref: "main" }
- { repo: "node-server-sdk", workflow: "lint-test-sdk.yml", ref: "main" }
- { repo: "php-sdk", workflow: "run-tests.yml", ref: "main" }
- { repo: "python-sdk", workflow: "lint-test-sdk.yml", ref: "main" }
- { repo: "react-native-sdk", workflow: "ci.yml", ref: "main" }
steps:
- name: Display workflow details
shell: bash
run: |
echo "Testing eppo-exp/${{ matrix.sdk.repo }}"
echo "Testing eppo-exp/${{ matrix.sdk.repo }}/${{ matrix.sdk.workflow }}"
- name: Run remote workflow
uses: convictional/[email protected]
with:
Expand Down
28 changes: 16 additions & 12 deletions .github/workflows/test-sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
paths:
- 'ufc/**'

workflow_dispatch:

jobs:
Expand All @@ -13,7 +14,13 @@ jobs:
with:
test_data_branch: ${{ github.head_ref || github.ref_name }}
sdk_branch: main


test-java-common-sdk:
uses: Eppo-exp/sdk-common-jdk/.github/workflows/lint-test-sdk.yml@main
with:
test_data_branch: ${{ github.head_ref || github.ref_name }}
sdk_branch: main

test-android-sdk:
uses: Eppo-exp/android-sdk/.github/workflows/test.yaml@main
with:
Expand All @@ -26,7 +33,7 @@ jobs:
test_data_branch: ${{ github.head_ref || github.ref_name }}
sdk_branch: main

test-node-client-sdk:
test-js-client-sdk:
uses: Eppo-exp/js-client-sdk/.github/workflows/lint-test-sdk.yml@main
with:
test_data_branch: ${{ github.head_ref || github.ref_name }}
Expand All @@ -37,16 +44,13 @@ jobs:
with:
test_data_branch: ${{ github.head_ref || github.ref_name }}
sdk_branch: main

test-python-sdk:
runs-on: ubuntu-latest
steps:
- name: "Run test action"
uses: 'Eppo-exp/python-sdk/.github/actions/action-test@main'
with:
test_data_branch: ${{ github.head_ref || github.ref_name }}
sdk_branch: main


test-multiplatform-sdk:
uses: 'Eppo-exp/eppo-multiplatform/.github/workflows/ci.yml@main'
with:
test_data_branch: ${{ github.head_ref || github.ref_name }}
sdk_branch: main

test-php-sdk:
uses: Eppo-exp/php-sdk/.github/workflows/run-tests.yml@main
with:
Expand Down
102 changes: 102 additions & 0 deletions .github/workflows/test-server-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Test Packaged Server SDKs

on:
workflow_call:
inputs:
platform:
description: 'Platforms to test the SDK Relay on; linux, macos, windows'
type: string
required: true
sdkName:
description: 'Name of the SDK'
type: string
required: true
sdkRelayDir:
description: 'Directory of the SDK Relay server code'
type: string
required: false
os:
description: 'Specific runner OS to use'
type: string


jobs:
test-packaged-server-sdks:
runs-on: ${{ inputs.os || inputs.platform == 'linux' && 'ubuntu-latest' || inputs.platform == 'macos' && 'macos-13' || inputs.platform == 'windows' && 'windows-latest' || 'NONE' }}

env:
SDK_NAME: ${{ inputs.sdkName }}
SDK_DIR: ${{ inputs.sdkRelayDir }}
EPPO_API_HOST: localhost
SDK_RELAY_HOST: localhost
TEST_RUNNER_HOST: localhost
EPPO_SDK_PLATFORM: ${{ inputs.platform }}

PROJECT_ID: ${{ vars.SDK_TESTING_PROJECT_ID }}
REGION: ${{ vars.SDK_TESTING_REGION }}
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'
2 changes: 1 addition & 1 deletion .github/workflows/validate-test-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/**'
- '.github/workflows/validate-test-data.yml'
- 'ufc/tests/**'
push:
branches:
Expand Down
Loading

0 comments on commit 8412783

Please sign in to comment.