Skip to content

Commit f40c86e

Browse files
ci: use shared gh-actions/actions/contract-tests action (#164)
**Requirements** - [x] I have added test coverage for new or changed functionality - [x] I have followed the repository's [pull request submission guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests) - [x] I have validated my changes against all supported platform versions **Related issues** N/A — CI-only change. **Describe the solution you've provided** 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, so `GITHUB_TOKEN` was not used when downloading the contract test harness (leading to potential rate limiting). The shared action properly passes the token both as an `Authorization` header on the curl request and as the `GITHUB_TOKEN` env var for the downloader script. Since the shared action only handles downloading and running the harness (not building/starting the test service), the build and start steps are now explicit workflow steps. **Describe alternatives you've considered** Could have fixed the local action to forward the token to the Makefile, but using the shared action is more maintainable and consistent with other SDK repos. **Additional context** Both `java-server-sdk.yml` and `nightly-contract-tests.yml` are updated. The Makefile is left unchanged so local development workflows still work." Link to Devin session: https://app.devin.ai/sessions/02984ba491764e598f041b70041206ba Requested by: @kinyoklion <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > CI-only workflow changes; no application runtime or SDK library behavior is modified. > > **Overview** > Removes the repo-local **contract-tests** composite action and wires **java-server-sdk** and **nightly-contract-tests** workflows to **`launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1`**. > > Contract testing now **explicitly** runs `make build-contract-tests` and `make start-contract-test-service-bg` before the harness. **v2** and **v3** harness runs are separate steps (v3 pinned to `v3.0.0-alpha.6`), each passing **`GITHUB_TOKEN`**, suppression files via **`extra_params`**, and shared options like **`enable_persistence_tests: 'false'`**. Nightly v3 still passes **`-enable-long-running-tests`** through **`extra_params`**. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 3580edb. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 28962e5 commit f40c86e

3 files changed

Lines changed: 52 additions & 32 deletions

File tree

.github/actions/contract-tests/action.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/java-server-sdk.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,34 @@ jobs:
3737
workspace_path: 'lib/sdk/server'
3838
java_version: 8
3939

40-
- name: Contract Tests
41-
uses: ./.github/actions/contract-tests
40+
- name: Build Contract Test Service
41+
shell: bash
42+
run: make build-contract-tests -C lib/sdk/server
43+
44+
- name: Start Contract Test Service
45+
shell: bash
46+
run: make start-contract-test-service-bg -C lib/sdk/server
47+
48+
- name: Contract Tests (v2)
49+
uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1
4250
with:
43-
workspace_path: 'lib/sdk/server'
51+
test_service_port: '8000'
52+
token: ${{ secrets.GITHUB_TOKEN }}
53+
debug_logging: 'true'
54+
stop_service: 'false'
55+
enable_persistence_tests: 'false'
56+
extra_params: '-skip-from=lib/sdk/server/contract-tests/test-suppressions.txt'
57+
58+
- name: Contract Tests (v3)
59+
uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1
60+
with:
61+
test_service_port: '8000'
62+
version: 'v3.0.0-alpha.6'
63+
branch: 'v3.0.0-alpha.6'
4464
token: ${{ secrets.GITHUB_TOKEN }}
65+
debug_logging: 'true'
66+
enable_persistence_tests: 'false'
67+
extra_params: '-skip-from=lib/sdk/server/contract-tests/test-suppressions-fdv2.txt'
4568

4669
test-packaging:
4770
runs-on: ubuntu-latest

.github/workflows/nightly-contract-tests.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,34 @@ jobs:
2929
workspace_path: 'lib/sdk/server'
3030
java_version: 8
3131

32-
- name: Contract Tests (with long-running tests)
33-
uses: ./.github/actions/contract-tests
32+
- name: Build Contract Test Service
33+
shell: bash
34+
run: make build-contract-tests -C lib/sdk/server
35+
36+
- name: Start Contract Test Service
37+
shell: bash
38+
run: make start-contract-test-service-bg -C lib/sdk/server
39+
40+
- name: Contract Tests (v2)
41+
uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1
3442
with:
35-
workspace_path: 'lib/sdk/server'
43+
test_service_port: '8000'
44+
token: ${{ secrets.GITHUB_TOKEN }}
45+
debug_logging: 'true'
46+
stop_service: 'false'
47+
enable_persistence_tests: 'false'
48+
extra_params: '-skip-from=lib/sdk/server/contract-tests/test-suppressions.txt'
49+
50+
- name: Contract Tests v3 (with long-running tests)
51+
uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1
52+
with:
53+
test_service_port: '8000'
54+
version: 'v3.0.0-alpha.6'
55+
branch: 'v3.0.0-alpha.6'
3656
token: ${{ secrets.GITHUB_TOKEN }}
37-
test_harness_params_v3: '-enable-long-running-tests'
57+
debug_logging: 'true'
58+
enable_persistence_tests: 'false'
59+
extra_params: '-skip-from=lib/sdk/server/contract-tests/test-suppressions-fdv2.txt -enable-long-running-tests'
3860

3961
notify-slack-on-failure:
4062
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)