From fd4cc8aefb0cb4c7332f3437f500218415e37543 Mon Sep 17 00:00:00 2001 From: Tyler Potter Date: Fri, 30 Aug 2024 11:29:39 -0600 Subject: [PATCH] quality: Round 2 of SDK test workflow migrations (#58) --- .github/workflows/test-sdks-remote.yml | 58 ++++++---------------- .github/workflows/test-sdks.yml | 68 +++++--------------------- 2 files changed, 27 insertions(+), 99 deletions(-) diff --git a/.github/workflows/test-sdks-remote.yml b/.github/workflows/test-sdks-remote.yml index 8d7c76f..0239381 100644 --- a/.github/workflows/test-sdks-remote.yml +++ b/.github/workflows/test-sdks-remote.yml @@ -7,64 +7,34 @@ on: workflow_dispatch: jobs: - - test-php-sdk: - runs-on: ubuntu-latest - steps: - - name: Display workflow details - shell: bash - run: | - echo "Testing eppo-exp/php-sdk" - - name: Run remote workflow - uses: convictional/trigger-workflow-and-wait@v1.6.1 - with: - owner: Eppo-exp - repo: php-sdk - workflow_file_name: run-tests.yml - ref: main - github_token: ${{ secrets.AUTH_TOKEN }} - wait_interval: 10 - propagate_failure: true - trigger_workflow: true - wait_workflow: true - test-node-server-sdk: + test-sdks: runs-on: ubuntu-latest + strategy: + matrix: + sdk: + - { repo: "java-server-sdk", workflow: "lint-test-sdk.yml", ref: "main" } + - { repo: "php-sdk", workflow: "run-tests.yml", ref: "main" } + - { repo: "js-client-sdk", workflow: "lint-test-sdk.yml", ref: "main" } + - { repo: "python-sdk", workflow: "lint-test-sdk.yml", ref: "main" } + - { repo: "node-server-sdk", workflow: "lint-test-sdk.yml", ref: "main" } + - { repo: "dot-net-server-sdk", workflow: "run-tests.yml", ref: "main" } steps: - name: Display workflow details shell: bash run: | - echo "Testing eppo-exp/node-server-sdk" + echo "Testing eppo-exp/${{ matrix.sdk.repo }}" - name: Run remote workflow uses: convictional/trigger-workflow-and-wait@v1.6.1 with: owner: Eppo-exp - repo: node-server-sdk - workflow_file_name: lint-test-sdk.yml - ref: main + repo: ${{ matrix.sdk.repo }} + workflow_file_name: ${{ matrix.sdk.workflow }} + ref: ${{ matrix.sdk.ref }} github_token: ${{ secrets.AUTH_TOKEN }} wait_interval: 10 propagate_failure: true trigger_workflow: true wait_workflow: true - test-dotnet-sdk: - runs-on: ubuntu-latest - steps: - - name: Display workflow details - shell: bash - run: | - echo "Testing Eppo-exp/dot-net-server-sdk" - - name: Run remote workflow - uses: convictional/trigger-workflow-and-wait@v1.6.1 - with: - owner: Eppo-exp - repo: dot-net-server-sdk - workflow_file_name: run-tests.yml - ref: main - github_token: ${{ secrets.AUTH_TOKEN }} - wait_interval: 10 - propagate_failure: true - trigger_workflow: true - wait_workflow: true \ No newline at end of file diff --git a/.github/workflows/test-sdks.yml b/.github/workflows/test-sdks.yml index 28315df..6a770fc 100644 --- a/.github/workflows/test-sdks.yml +++ b/.github/workflows/test-sdks.yml @@ -9,21 +9,10 @@ on: jobs: test-java-sdk: - runs-on: macos-latest - steps: - - name: Check out Java SDK - uses: actions/checkout@v3 - with: - repository: 'Eppo-exp/java-server-sdk' - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'adopt' - - name: 'Set up GCP SDK' - uses: 'google-github-actions/setup-gcloud@v0' - - name: Run tests - run: make test + uses: Eppo-exp/java-server-sdk/.github/workflows/lint-test-sdk.yml@main + with: + test_data_branch: ${{ github.head_ref || github.ref_name }} + sdk_branch: main test-android-sdk: runs-on: macos-latest @@ -87,29 +76,11 @@ jobs: sdk_branch: main test-node-client-sdk: - runs-on: ubuntu-latest - steps: - - name: Check out node client SDK - uses: actions/checkout@v3 - with: - repository: 'Eppo-exp/js-client-sdk' - - name: Use Node.js 18 - uses: actions/setup-node@v1 - with: - node-version: '18.x' - - uses: actions/cache@v2 - with: - path: './node_modules' - key: ${{ runner.os }}-root-node-modules-${{ hashFiles('./yarn.lock') }} - - name: 'Set up GCP SDK for downloading test data' - uses: 'google-github-actions/setup-gcloud@v0' - - name: Install SDK dependencies - run: yarn --frozen-lockfile - working-directory: ./ - - name: Run tests - run: yarn test - working-directory: ./ - + uses: Eppo-exp/js-client-sdk/.github/workflows/lint-test-sdk.yml@main + with: + test_data_branch: ${{ github.head_ref || github.ref_name }} + sdk_branch: main + test-react-native-sdk: runs-on: ubuntu-latest steps: @@ -127,24 +98,11 @@ jobs: test-python-sdk: runs-on: ubuntu-latest steps: - - name: 'Check out Python SDK' - uses: "actions/checkout@v3" + - name: "Run test action" + uses: 'Eppo-exp/python-sdk/.github/actions/action-test@main' with: - repository: 'Eppo-exp/python-sdk' - - name: Install Python 3.9 - uses: "actions/setup-python@v2" - with: - python-version: '3.9.x' - - name: "Install dependencies" - run: | - python -VV - python -m pip install --upgrade pip setuptools wheel - python -m pip install -r requirements.txt - python -m pip install -r requirements-test.txt - - name: 'Set up GCP SDK to download test data' - uses: 'google-github-actions/setup-gcloud@v0' - - name: Run tests - run: make test + 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