Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/e2e-reusable.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: E2E Tests

on:
pull_request:
branches: [main]
repository_dispatch:
types: [module-release]
workflow_dispatch:
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-stellar-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions e2e/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down