From fba4f0bce0967ac4dd7e4b15cfe18505f6e0c7f5 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 15 May 2026 21:36:22 +0000 Subject: [PATCH] ci: use shared gh-actions/actions/contract-tests action Replace the local .github/actions/contract-tests action with the shared launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1 action. The local action accepted a token input but never forwarded it to the Makefile or curl commands, so the GITHUB_TOKEN was not used when downloading the contract test harness. The shared action properly passes the token both as an Authorization header and as the GITHUB_TOKEN env var to avoid rate limiting. The build and start steps are now explicit workflow steps since the shared action only handles downloading and running the harness. Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com> --- .github/actions/contract-tests/action.yml | 25 ---------------- .github/workflows/java-server-sdk.yml | 29 +++++++++++++++++-- .github/workflows/nightly-contract-tests.yml | 30 +++++++++++++++++--- 3 files changed, 52 insertions(+), 32 deletions(-) delete mode 100644 .github/actions/contract-tests/action.yml diff --git a/.github/actions/contract-tests/action.yml b/.github/actions/contract-tests/action.yml deleted file mode 100644 index 11aea5b3..00000000 --- a/.github/actions/contract-tests/action.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Contract Tests -description: Runs Contract Tests (builds, starts service, runs SDK contract test harness) -inputs: - workspace_path: - description: 'Path to the package (e.g. lib/sdk/server).' - required: true - token: - description: 'Github token, used for contract tests' - required: false - default: '' - test_harness_params_v2: - description: 'Optional extra parameters for the SDK test harness v2. Passed as TEST_HARNESS_PARAMS_V2 to make.' - required: false - default: '' - test_harness_params_v3: - description: 'Optional extra parameters for the SDK test harness v3 (e.g. -enable-long-running-tests). Passed as TEST_HARNESS_PARAMS_V3 to make.' - required: false - default: '' - -runs: - using: composite - steps: - - name: Run contract tests - shell: bash - run: make contract-tests -C ${{ inputs.workspace_path }} TEST_HARNESS_PARAMS_V2="${{ inputs.test_harness_params_v2 }}" TEST_HARNESS_PARAMS_V3="${{ inputs.test_harness_params_v3 }}" diff --git a/.github/workflows/java-server-sdk.yml b/.github/workflows/java-server-sdk.yml index 10e56be4..e7e42dba 100644 --- a/.github/workflows/java-server-sdk.yml +++ b/.github/workflows/java-server-sdk.yml @@ -37,11 +37,34 @@ jobs: workspace_path: 'lib/sdk/server' java_version: 8 - - name: Contract Tests - uses: ./.github/actions/contract-tests + - name: Build Contract Test Service + shell: bash + run: make build-contract-tests -C lib/sdk/server + + - name: Start Contract Test Service + shell: bash + run: make start-contract-test-service-bg -C lib/sdk/server + + - name: Contract Tests (v2) + uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1 with: - workspace_path: 'lib/sdk/server' + test_service_port: '8000' + token: ${{ secrets.GITHUB_TOKEN }} + debug_logging: 'true' + stop_service: 'false' + enable_persistence_tests: 'false' + extra_params: '-skip-from=lib/sdk/server/contract-tests/test-suppressions.txt' + + - name: Contract Tests (v3) + uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1 + with: + test_service_port: '8000' + version: 'v3.0.0-alpha.6' + branch: 'v3.0.0-alpha.6' token: ${{ secrets.GITHUB_TOKEN }} + debug_logging: 'true' + enable_persistence_tests: 'false' + extra_params: '-skip-from=lib/sdk/server/contract-tests/test-suppressions-fdv2.txt' test-packaging: runs-on: ubuntu-latest diff --git a/.github/workflows/nightly-contract-tests.yml b/.github/workflows/nightly-contract-tests.yml index 14a0db3d..adeb24f7 100644 --- a/.github/workflows/nightly-contract-tests.yml +++ b/.github/workflows/nightly-contract-tests.yml @@ -29,12 +29,34 @@ jobs: workspace_path: 'lib/sdk/server' java_version: 8 - - name: Contract Tests (with long-running tests) - uses: ./.github/actions/contract-tests + - name: Build Contract Test Service + shell: bash + run: make build-contract-tests -C lib/sdk/server + + - name: Start Contract Test Service + shell: bash + run: make start-contract-test-service-bg -C lib/sdk/server + + - name: Contract Tests (v2) + uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1 with: - workspace_path: 'lib/sdk/server' + test_service_port: '8000' + token: ${{ secrets.GITHUB_TOKEN }} + debug_logging: 'true' + stop_service: 'false' + enable_persistence_tests: 'false' + extra_params: '-skip-from=lib/sdk/server/contract-tests/test-suppressions.txt' + + - name: Contract Tests v3 (with long-running tests) + uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1 + with: + test_service_port: '8000' + version: 'v3.0.0-alpha.6' + branch: 'v3.0.0-alpha.6' token: ${{ secrets.GITHUB_TOKEN }} - test_harness_params_v3: '-enable-long-running-tests' + debug_logging: 'true' + enable_persistence_tests: 'false' + extra_params: '-skip-from=lib/sdk/server/contract-tests/test-suppressions-fdv2.txt -enable-long-running-tests' notify-slack-on-failure: runs-on: ubuntu-latest