-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (94 loc) · 3.65 KB
/
Copy pathe2e.yml
File metadata and controls
102 lines (94 loc) · 3.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: E2E Tests
on:
pull_request:
branches: [main]
repository_dispatch:
types: [module-release]
workflow_dispatch:
inputs:
contracts_version:
description: "soroban-core release tag (e.g. v0.1.0)"
required: false
default: "latest"
provider_version:
description: "provider-platform image tag (e.g. 0.2.0)"
required: false
default: "latest"
stellar_cli_version:
description: "stellar-cli image tag (e.g. 0.1.0)"
required: false
default: "latest"
env:
REGISTRY: ghcr.io
ORG: moonlight-protocol
jobs:
e2e:
runs-on: ubuntu-latest
permissions:
packages: read
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.E2E_TRIGGER_TOKEN }}
- name: Resolve versions
id: versions
run: |
# repository_dispatch: use payload version for the triggering module, latest for the rest
# workflow_dispatch: use inputs
if [ "${{ github.event_name }}" = "repository_dispatch" ]; then
MODULE="${{ github.event.client_payload.module }}"
VERSION="${{ github.event.client_payload.version }}"
case "$MODULE" in
soroban-core) echo "contracts=$VERSION" >> "$GITHUB_OUTPUT" ;;
*) echo "contracts=latest" >> "$GITHUB_OUTPUT" ;;
esac
case "$MODULE" in
provider-platform) echo "provider=$VERSION" >> "$GITHUB_OUTPUT" ;;
*) echo "provider=latest" >> "$GITHUB_OUTPUT" ;;
esac
case "$MODULE" in
stellar-cli) echo "stellar_cli=$VERSION" >> "$GITHUB_OUTPUT" ;;
*) echo "stellar_cli=latest" >> "$GITHUB_OUTPUT" ;;
esac
else
echo "contracts=${{ inputs.contracts_version || 'latest' }}" >> "$GITHUB_OUTPUT"
echo "provider=${{ inputs.provider_version || 'latest' }}" >> "$GITHUB_OUTPUT"
echo "stellar_cli=${{ inputs.stellar_cli_version || 'latest' }}" >> "$GITHUB_OUTPUT"
fi
- 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
env:
GH_TOKEN: ${{ secrets.E2E_TRIGGER_TOKEN }}
VERSION: ${{ steps.versions.outputs.contracts }}
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: Load Stellar quickstart pin (SSOT)
run: |
set -a
. "$GITHUB_WORKSPACE/stellar-pin.env"
set +a
echo "STELLAR_QUICKSTART_IMAGE=$STELLAR_QUICKSTART_IMAGE" >> "$GITHUB_ENV"
echo "STELLAR_PROTOCOL_VERSION=$STELLAR_PROTOCOL_VERSION" >> "$GITHUB_ENV"
- name: Run E2E tests
env:
STELLAR_CLI_IMAGE: ${{ env.REGISTRY }}/${{ env.ORG }}/stellar-cli:${{ steps.versions.outputs.stellar_cli }}
PROVIDER_IMAGE: ${{ env.REGISTRY }}/${{ env.ORG }}/provider-platform:${{ steps.versions.outputs.provider }}
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