@@ -2,6 +2,9 @@ name: Catalyst Gateway integration tests
22
33on :
44 workflow_call :
5+ secrets :
6+ QA_REPO_SSH_KEY :
7+ required : true
58
69concurrency :
710 group : gateway-tests-${{ github.head_ref || github.ref }}
@@ -38,11 +41,12 @@ jobs:
3841 with :
3942 enable_caching : " true"
4043 version : 0.21.0
44+
4145 - name : Setup
4246 uses : input-output-hk/catalyst-forge/actions/setup@ci/v1.10.0
4347
4448 - name : Prepare artifacts
45- id : images
49+ id : images
4650 uses : input-output-hk/catalyst-forge/actions/run@ci/v1.10.0
4751 with :
4852 command : run
8488 exit 1
8589 fi
8690
87- - name : Schemathesis tests
88- if : ${{ steps.gateway-healthy.conclusion == 'success' }}
89- run : |
90- docker compose -f catalyst-gateway/tests/docker-compose.yml up schemathesis-runner --exit-code-from schemathesis-runner
91- docker cp schemathesis-runner:/results/junit-report.xml ./schemathesis${{ env.REPORT_EXT }}
92-
9391 - name : Integration API tests
9492 if : ${{ steps.gateway-healthy.conclusion == 'success' }}
9593 env :
@@ -123,3 +121,120 @@ jobs:
123121 path : " **/*${{ env.COVERAGE_EXT }}"
124122 if-no-files-found : error
125123 retention-days : 1
124+
125+ devnet-tests :
126+ name : Cat-Gateway devnet integration tests
127+ runs-on : ubuntu-latest
128+ steps :
129+ - uses : actions/checkout@v4
130+
131+ - name : Install Forge
132+ uses : input-output-hk/catalyst-forge/actions/install@ci/v1.10.0
133+ with :
134+ enable_caching : " true"
135+ version : 0.21.0
136+
137+ - name : Setup
138+ uses : input-output-hk/catalyst-forge/actions/setup@ci/v1.10.0
139+
140+ - name : Prepare artifacts
141+ id : images
142+ uses : input-output-hk/catalyst-forge/actions/run@ci/v1.10.0
143+ with :
144+ command : run
145+ args : ./catalyst-gateway/tests/+all-images
146+
147+ - name : Setup SSH Agent
148+ uses :
webfactory/[email protected] 149+ with :
150+ ssh-private-key : ${{ secrets.QA_REPO_SSH_KEY }}
151+
152+ - name : Prepare artifacts devnet
153+ id : images-devnet
154+ uses : input-output-hk/catalyst-forge/actions/run@ci/v1.10.0
155+ with :
156+ command : run
157+ args : ./catalyst-gateway/tests/+images-devnet
158+
159+ - name : Spin up devnet
160+ if : ${{ steps.images-devnet.conclusion == 'success' }}
161+ run : |
162+ docker compose -f catalyst-gateway/tests/docker-compose-devnet.yml up cat-devnet -d
163+
164+ - name : Wait for cat-devnet to become healthy
165+ id : devnet-check
166+ run : |
167+ DEVNET_HEALTHY="false"
168+ echo "Waiting for container to be healthy ..."
169+ for i in {1..500}; do
170+ STATUS=$(docker inspect --format='{{.State.Health.Status}}' cat-devnet)
171+ echo "Health status: $STATUS"
172+ if [ "$STATUS" == "healthy" ]; then
173+ echo "Container is healthy!"
174+ DEVNET_HEALTHY="true"
175+ echo "devnet_healthy=$DEVNET_HEALTHY" >> $GITHUB_OUTPUT
176+ exit 0
177+ fi
178+ if [ "$STATUS" == "unhealthy" ]; then
179+ echo "Container became unhealthy."
180+ docker compose -f catalyst-gateway/tests/docker-compose-devnet.yml logs cat-devnet
181+ docker compose -f catalyst-gateway/tests/docker-compose-devnet.yml stop cat-devnet
182+ echo "devnet_healthy=$DEVNET_HEALTHY" >> $GITHUB_OUTPUT
183+ break
184+ fi
185+ sleep 5
186+ done
187+
188+ - name : Spin up devnet ... retry
189+ if : steps.devnet-check.outputs.devnet_healthy == 'false'
190+ run : |
191+ docker compose -f catalyst-gateway/tests/docker-compose-devnet.yml up cat-devnet -d
192+
193+ - name : Wait for cat-devnet to become healthy ... retry
194+ if : steps.devnet-check.outputs.devnet_healthy == 'false'
195+ run : |
196+ echo "Waiting for container to be healthy ... retry"
197+ for i in {1..500}; do
198+ STATUS=$(docker inspect --format='{{.State.Health.Status}}' cat-devnet)
199+ echo "Health status: $STATUS"
200+ if [ "$STATUS" == "healthy" ]; then
201+ echo "Container is healthy!"
202+ exit 0
203+ fi
204+ if [ "$STATUS" == "unhealthy" ]; then
205+ echo "Container became unhealthy."
206+ docker compose -f catalyst-gateway/tests/docker-compose-devnet.yml logs cat-devnet
207+ exit 1
208+ fi
209+ sleep 5
210+ done
211+
212+ - name : Spin up catalyst-gateway
213+ id : gateway-started
214+ run : |
215+ docker compose -f catalyst-gateway/tests/docker-compose-devnet.yml up cat-gateway -d
216+
217+ - name : Wait for cat-gateway to become healthy
218+ id : gateway-healthy
219+ if : ${{ steps.gateway-started.conclusion == 'success' }}
220+ run : |
221+ echo "Waiting for container to be healthy..."
222+ for i in {1..500}; do
223+ STATUS=$(docker inspect --format='{{.State.Health.Status}}' cat-gateway)
224+ echo "Health status: $STATUS"
225+ if [ "$STATUS" == "healthy" ]; then
226+ echo "Container is healthy!"
227+ break
228+ fi
229+ if [ "$STATUS" == "unhealthy" ]; then
230+ echo "Container became unhealthy."
231+ docker compose -f catalyst-gateway/tests/docker-compose-devnet.yml logs cat-gateway
232+ exit 1
233+ fi
234+ sleep 5
235+ done
236+
237+ - name : Schemathesis tests
238+ if : ${{ steps.gateway-healthy.conclusion == 'success' }}
239+ run : |
240+ docker compose -f catalyst-gateway/tests/docker-compose-devnet.yml up schemathesis-runner --exit-code-from schemathesis-runner
0 commit comments