From 0f5816c09b821520d55e9c81dc7b3fcf01746a5f Mon Sep 17 00:00:00 2001 From: Gorka Date: Tue, 10 Mar 2026 15:17:40 -0300 Subject: [PATCH 1/2] Add reusable E2E workflow, PR trigger, and latest tag for stellar-cli - Extract E2E logic into reusable workflow_call for cross-repo PR checks - Add pull_request trigger to run E2E on local-dev PRs - Add latest tag to stellar-cli release workflow --- .github/workflows/e2e-reusable.yml | 85 +++++++++++++++++++++++ .github/workflows/e2e.yml | 6 +- .github/workflows/release-stellar-cli.yml | 1 + 3 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/e2e-reusable.yml diff --git a/.github/workflows/e2e-reusable.yml b/.github/workflows/e2e-reusable.yml new file mode 100644 index 0000000..0e00c15 --- /dev/null +++ b/.github/workflows/e2e-reusable.yml @@ -0,0 +1,85 @@ +name: E2E Tests (Reusable) + +on: + workflow_call: + inputs: + contracts_version: + description: "soroban-core release tag (e.g. v0.1.0)" + type: string + default: "latest" + provider_version: + description: "provider-platform image tag (e.g. 0.2.0)" + type: string + default: "latest" + stellar_cli_version: + description: "stellar-cli image tag (e.g. 0.1.0)" + type: string + default: "latest" + contracts_artifact: + description: "Name of a workflow artifact containing wasms (overrides release download)" + type: string + default: "" + provider_image_override: + description: "Full image ref override for provider-platform (e.g. ghcr.io/org/repo:sha-abc123)" + type: string + default: "" + secrets: + E2E_TRIGGER_TOKEN: + required: true + +env: + REGISTRY: ghcr.io + ORG: moonlight-protocol + +jobs: + e2e: + runs-on: ubuntu-latest + permissions: + packages: read + steps: + - uses: actions/checkout@v4 + with: + repository: moonlight-protocol/local-dev + ref: main + token: ${{ secrets.E2E_TRIGGER_TOKEN }} + + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.E2E_TRIGGER_TOKEN }} + + - name: Download contract wasms from artifact + if: inputs.contracts_artifact != '' + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.contracts_artifact }} + path: e2e/wasms + + - name: Download contract wasms from release + if: inputs.contracts_artifact == '' + env: + GH_TOKEN: ${{ secrets.E2E_TRIGGER_TOKEN }} + VERSION: ${{ inputs.contracts_version }} + run: | + mkdir -p e2e/wasms + if [ "$VERSION" = "latest" ]; then + gh release download --repo ${{ env.ORG }}/soroban-core -p '*.wasm' -D e2e/wasms/ + else + gh release download "$VERSION" --repo ${{ env.ORG }}/soroban-core -p '*.wasm' -D e2e/wasms/ + fi + ls -la e2e/wasms/ + + - name: Run E2E tests + env: + STELLAR_CLI_IMAGE: ${{ env.REGISTRY }}/${{ env.ORG }}/stellar-cli:${{ inputs.stellar_cli_version }} + PROVIDER_IMAGE: ${{ inputs.provider_image_override != '' && inputs.provider_image_override || format('{0}/{1}/provider-platform:{2}', env.REGISTRY, env.ORG, inputs.provider_version) }} + working-directory: e2e + run: | + docker compose up -d + EXIT_CODE=$(docker wait e2e-test-runner-1) + echo "--- test-runner logs ---" + docker compose logs test-runner + docker compose down + exit $EXIT_CODE diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index c40d26f..2ede620 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,6 +1,8 @@ name: E2E Tests on: + pull_request: + branches: [main] repository_dispatch: types: [module-release] workflow_dispatch: @@ -85,9 +87,7 @@ jobs: working-directory: e2e run: | docker compose up -d - # Wait for test-runner to finish and capture its exit code - docker wait e2e-test-runner-1 - EXIT_CODE=$? + EXIT_CODE=$(docker wait e2e-test-runner-1) echo "--- test-runner logs ---" docker compose logs test-runner docker compose down diff --git a/.github/workflows/release-stellar-cli.yml b/.github/workflows/release-stellar-cli.yml index 05990e0..b651ae8 100644 --- a/.github/workflows/release-stellar-cli.yml +++ b/.github/workflows/release-stellar-cli.yml @@ -32,6 +32,7 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=match,pattern=stellar-cli-v(.*),group=1 + type=raw,value=latest - name: Build and push uses: docker/build-push-action@v6 From 2a8553abf8ac8da8ec3ab295dccd7ef7763078f4 Mon Sep 17 00:00:00 2001 From: Gorka Date: Tue, 10 Mar 2026 16:01:29 -0300 Subject: [PATCH 2/2] Write STELLAR_RPC_URL to provider.env in setup script --- e2e/setup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/e2e/setup.sh b/e2e/setup.sh index 6aa5c08..2a140c6 100755 --- a/e2e/setup.sh +++ b/e2e/setup.sh @@ -100,6 +100,7 @@ MODE=development LOG_LEVEL=TRACE SERVICE_DOMAIN=localhost +STELLAR_RPC_URL=$STELLAR_RPC_URL NETWORK=local NETWORK_FEE=1000000000 CHANNEL_CONTRACT_ID=$CHANNEL_ID