This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
211 lines (184 loc) · 7.77 KB
/
topos:integration-tests.yml
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
name: Topos Integration Tests
on:
pull_request:
branches:
- main
workflow_dispatch:
inputs:
local-erc20-messaging-infra-ref:
description: "Git ref of local-erc20-messaging-infra"
required: false
topos-docker-tag:
description: "Docker tag of topos"
required: false
topos-smart-contracts-docker-tag:
description: "Docker tag of topos-smart-contracts"
required: false
env:
TOPOS_DOCKER_TAG: ${{ inputs.topos-docker-tag || 'latest' }}
CONTRACTS_DOCKER_TAG: ${{ inputs.topos-smart-contracts-docker-tag || 'latest' }}
jobs:
infra-metadata:
uses: ./.github/workflows/util:get-latest-release.yml
with:
organization: topos-protocol
repository: local-erc20-messaging-infra
e2e:
runs-on: ubuntu-latest-16-core
environment: devnet-1
env:
INFRA_REF: ${{ inputs.local-erc20-messaging-infra-ref || needs.infra-metadata.outputs.latest-release }}
needs:
- infra-metadata
steps:
- name: Display stack component versions
run: |
echo "infra ref: ${{ env.INFRA_REF }}"
echo "topos docker tag: ${{ env.TOPOS_DOCKER_TAG }}"
echo "contracts docker tag: ${{ env.CONTRACTS_DOCKER_TAG }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Checkout local-erc20-messaging-infra repo
uses: actions/checkout@v3
with:
repository: topos-protocol/local-erc20-messaging-infra
ref: ${{ env.INFRA_REF }}
path: infra
- name: Install node dependencies
run: |
cd infra &&
npm install
- name: Setup environment
run: |
cd infra
cat .env | grep -v '^\s*$\|^\s*\#' | xargs -I {} echo "{}" >> $GITHUB_ENV
echo "LOCAL_ERC20_HOME=${PWD}" >> $GITHUB_ENV
echo "TOPOS_MESSAGING_PROTOCOL_CONTRACTS_VERSION=${{ env.CONTRACTS_DOCKER_TAG }}" >> $GITHUB_ENV
echo "TOPOS_VERSION=${{ env.TOPOS_DOCKER_TAG }}" >> $GITHUB_ENV
- name: Start local ERC20 messaging infra containers
run: >
cd infra &&
./tests/network.sh start
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
TOKEN_DEPLOYER_SALT: ${{ secrets.TOKEN_DEPLOYER_SALT }}
TOPOS_CORE_SALT: ${{ secrets.TOPOS_CORE_SALT }}
TOPOS_CORE_PROXY_SALT: ${{ secrets.TOPOS_CORE_PROXY_SALT }}
ERC20_MESSAGING_SALT: ${{ secrets.ERC20_MESSAGING_SALT }}
SUBNET_REGISTRATOR_SALT: ${{ secrets.SUBNET_REGISTRATOR_SALT }}
- name: Debug containers
if: failure()
run: docker inspect contracts-topos | grep Image && docker logs contracts-topos
- name: Get contracts .env file and expose contract addresses for test scripts
run: |
mkdir ./contracts
docker cp contracts-topos:/contracts/.env ./contracts/.env
source ./contracts/.env
echo "SUBNET_REGISTRATOR_CONTRACT_ADDRESS=${SUBNET_REGISTRATOR_CONTRACT_ADDRESS}" >> $GITHUB_ENV
echo "ERC20_MESSAGING_CONTRACT_ADDRESS=${ERC20_MESSAGING_CONTRACT_ADDRESS}" >> $GITHUB_ENV
echo "TOPOS_CORE_PROXY_CONTRACT_ADDRESS=${TOPOS_CORE_PROXY_CONTRACT_ADDRESS}" >> $GITHUB_ENV
- name: Run network health check tests
run: >
cd infra &&
./tests/test_network_health.sh
env:
DOCKER_DEFAULT_PLATFORM: linux/amd64
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
TOKEN_DEPLOYER_SALT: ${{ secrets.TOKEN_DEPLOYER_SALT }}
TOPOS_CORE_SALT: ${{ secrets.TOPOS_CORE_SALT }}
TOPOS_CORE_PROXY_SALT: ${{ secrets.TOPOS_CORE_PROXY_SALT }}
ERC20_MESSAGING_SALT: ${{ secrets.ERC20_MESSAGING_SALT }}
SUBNET_REGISTRATOR_SALT: ${{ secrets.SUBNET_REGISTRATOR_SALT }}
- name: Run certificates production tests
run: >
cd infra &&
./tests/test_cert_production.sh
env:
DOCKER_DEFAULT_PLATFORM: linux/amd64
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
TOKEN_DEPLOYER_SALT: ${{ secrets.TOKEN_DEPLOYER_SALT }}
TOPOS_CORE_SALT: ${{ secrets.TOPOS_CORE_SALT }}
TOPOS_CORE_PROXY_SALT: ${{ secrets.TOPOS_CORE_PROXY_SALT }}
ERC20_MESSAGING_SALT: ${{ secrets.ERC20_MESSAGING_SALT }}
SUBNET_REGISTRATOR_SALT: ${{ secrets.SUBNET_REGISTRATOR_SALT }}
- name: Run certificate delivery test
run: >
cd infra &&
./tests/test_cert_delivery.sh
env:
DOCKER_DEFAULT_PLATFORM: linux/amd64
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
TOKEN_DEPLOYER_SALT: ${{ secrets.TOKEN_DEPLOYER_SALT }}
TOPOS_CORE_SALT: ${{ secrets.TOPOS_CORE_SALT }}
TOPOS_CORE_PROXY_SALT: ${{ secrets.TOPOS_CORE_PROXY_SALT }}
ERC20_MESSAGING_SALT: ${{ secrets.ERC20_MESSAGING_SALT }}
SUBNET_REGISTRATOR_SALT: ${{ secrets.SUBNET_REGISTRATOR_SALT }}
- name: Run transaction included in certificate test
run: >
cd infra &&
./tests/test_transaction_in_certificate.sh
env:
DOCKER_DEFAULT_PLATFORM: linux/amd64
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
TOKEN_DEPLOYER_SALT: ${{ secrets.TOKEN_DEPLOYER_SALT }}
TOPOS_CORE_SALT: ${{ secrets.TOPOS_CORE_SALT }}
TOPOS_CORE_PROXY_SALT: ${{ secrets.TOPOS_CORE_PROXY_SALT }}
ERC20_MESSAGING_SALT: ${{ secrets.ERC20_MESSAGING_SALT }}
SUBNET_REGISTRATOR_SALT: ${{ secrets.SUBNET_REGISTRATOR_SALT }}
- name: Run target sequencer cert delivery test
run: >
cd infra &&
./tests/test_cert_sequencer_delivery.sh
env:
DOCKER_DEFAULT_PLATFORM: linux/amd64
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
TOKEN_DEPLOYER_SALT: ${{ secrets.TOKEN_DEPLOYER_SALT }}
TOPOS_CORE_SALT: ${{ secrets.TOPOS_CORE_SALT }}
TOPOS_CORE_PROXY_SALT: ${{ secrets.TOPOS_CORE_PROXY_SALT }}
ERC20_MESSAGING_SALT: ${{ secrets.ERC20_MESSAGING_SALT }}
SUBNET_REGISTRATOR_SALT: ${{ secrets.SUBNET_REGISTRATOR_SALT }}
- name: Run certificate inclusion test
run: >
cd infra &&
./tests/test_cert_inclusion.sh
env:
DOCKER_DEFAULT_PLATFORM: linux/amd64
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
TOKEN_DEPLOYER_SALT: ${{ secrets.TOKEN_DEPLOYER_SALT }}
TOPOS_CORE_SALT: ${{ secrets.TOPOS_CORE_SALT }}
TOPOS_CORE_PROXY_SALT: ${{ secrets.TOPOS_CORE_PROXY_SALT }}
ERC20_MESSAGING_SALT: ${{ secrets.ERC20_MESSAGING_SALT }}
SUBNET_REGISTRATOR_SALT: ${{ secrets.SUBNET_REGISTRATOR_SALT }}
- name: Debug docker show infra containers
if: failure()
run: docker ps
- name: Debug sending sequencer
if: failure()
run: docker logs topos-sequencer
- name: Debug receiving sequencer
if: failure()
run: docker logs incal-sequencer
- name: Debug TCE boot node
if: failure()
run: docker logs topos-node-1 || docker logs infra-tce-boot-1
- name: Debug TCE peer node 2
if: failure()
run: docker logs topos-node-2 || docker logs infra-tce-peer-1
- name: Debug TCE peer node 3
if: failure()
run: docker logs topos-node-3 || docker logs infra-tce-peer-2
- name: Debug TCE peer node 4
if: failure()
run: docker logs topos-node-4 || docker logs infra-tce-peer-3
- name: Debug Incal node 1
if: failure()
run: docker logs incal-node-1