Skip to content

Commit eb43ea6

Browse files
committed
pre build images job, try 10
1 parent 66d1bd5 commit eb43ea6

File tree

2 files changed

+307
-306
lines changed

2 files changed

+307
-306
lines changed

.github/workflows/nightly-ci.yml

Lines changed: 44 additions & 305 deletions
Original file line numberDiff line numberDiff line change
@@ -15,50 +15,16 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
18-
build-images:
19-
name: Build images
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: actions/checkout@v4
23-
24-
- name: Install Forge
25-
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.10.0
26-
with:
27-
enable_caching: "true"
28-
version: 0.21.0
29-
30-
- name: Setup
31-
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.10.0
32-
33-
- name: Prepare artifacts
34-
id: images
35-
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.10.0
36-
with:
37-
command: run
38-
args: ./catalyst-gateway/tests/+all-images
39-
40-
- name: Save image to tar
41-
run: |
42-
docker save cat-gateway:latest -o cat-gateway.tar
43-
docker save event-db:latest -o event-db.tar
44-
docker save api-tests-runner:latest -o api-tests-runner.tar
45-
docker save schemathesis-runner:latest -o schemathesis-runner.tar
46-
docker save rust-tests-runner:latest -o rust-tests-runner.tar
47-
docker save event-db:v1 -o event-db-v1.tar
48-
docker save haproxy-node:latest -o haproxy-node.tar
49-
# docker save cat-devnet:latest -o cat-devnet.tar
50-
mkdir all-images
51-
mv *.tar all-images/
52-
53-
- uses: actions/upload-artifact@v4
54-
with:
55-
name: all-images
56-
path: all-images/
18+
ci-nightly:
19+
uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.10.0
20+
with:
21+
forge_version: 0.21.0
22+
skip_deploy: true
23+
skip_release: true
5724

5825
tests:
59-
name: Cat-Gateway integration tests
26+
name: nightly tests
6027
runs-on: ubuntu-latest
61-
needs: build-images
6228
steps:
6329
- uses: actions/checkout@v4
6430

@@ -86,34 +52,16 @@ jobs:
8652
- name: Setup
8753
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.10.0
8854

89-
- name: Get artifacts
90-
id: get-images
91-
uses: actions/download-artifact@v4
55+
- name: Prepare artifacts
56+
id : images
57+
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.10.0
9258
with:
93-
name: all-images
94-
path: all-images/
95-
96-
- name: Load image
97-
id: load-images
98-
run: |
99-
docker load -i ./all-images/cat-gateway.tar
100-
docker load -i ./all-images/event-db.tar
101-
docker load -i ./all-images/api-tests-runner.tar
102-
docker load -i ./all-images/schemathesis-runner.tar
103-
docker load -i ./all-images/rust-tests-runner.tar
104-
docker load -i ./all-images/event-db-v1.tar
105-
docker load -i ./all-images/haproxy-node.tar
106-
rm -rf ./all-images
107-
108-
- name: Rust integration tests
109-
if: ${{ steps.load-images.conclusion == 'success' }}
110-
run: |
111-
docker compose -f catalyst-gateway/tests/docker-compose.yml up rust-tests-runner --exit-code-from rust-tests-runner
112-
docker compose -f catalyst-gateway/tests/docker-compose.yml down
59+
command: run
60+
args: ./catalyst-gateway/tests/+all-images
11361

11462
- name: Spin up catalyst-gateway
11563
id: gateway-started
116-
if: ${{ steps.load-images.conclusion == 'success' }}
64+
if: ${{ steps.images.conclusion == 'success' }}
11765
run: |
11866
docker compose -f catalyst-gateway/tests/docker-compose.yml up cat-gateway --detach
11967
@@ -131,129 +79,33 @@ jobs:
13179
fi
13280
if [ "$STATUS" == "unhealthy" ]; then
13381
echo "Container became unhealthy."
134-
break
82+
docker logs cat-gateway
83+
exit 1
13584
fi
13685
sleep 5
13786
done
138-
139-
if [ "$STATUS" != "healthy" ]; then
140-
docker compose -f catalyst-gateway/tests/docker-compose.yml logs cat-gateway
141-
exit 1
142-
fi
14387
144-
- name: Integration API tests
88+
- name: Schemathesis tests
89+
id: schemathesis-tests
14590
if: ${{ steps.gateway-healthy.conclusion == 'success' }}
146-
env:
147-
API_TEST_MARKS: "preprod_indexing or unmarked"
14891
run: |
149-
docker compose -f catalyst-gateway/tests/docker-compose.yml up api-tests-runner --exit-code-from api-tests-runner
150-
docker cp api-tests-runner:/poetry/junit-report.xml ./api-tests${{ env.REPORT_EXT }}
151-
docker cp api-tests-runner:/poetry/coverage.lcov ./api-tests${{ env.COVERAGE_EXT }}
92+
export HYPOTHESIS_MAX_EXAMPLES=5000
93+
export MAX_RESPONSE_TIME=25000
94+
docker compose -f catalyst-gateway/tests/docker-compose.yml up schemathesis-runner --exit-code-from schemathesis-runner
15295
153-
- name: Integration health tests
154-
if: ${{ steps.gateway-healthy.conclusion == 'success' }}
96+
- name: Spin up catalyst-gateway with haproxy
97+
id: gateway-with-proxy-started
15598
env:
156-
API_TEST_MARKS: "health_endpoint"
157-
run: |
158-
docker compose -f catalyst-gateway/tests/docker-compose.yml up api-tests-runner --exit-code-from api-tests-runner
159-
#
160-
# - name: Collect and upload test reports
161-
# uses: actions/upload-artifact@v4
162-
# if: success() || failure()
163-
# with:
164-
# name: test-reports-gateway
165-
# path: "**/*${{ env.REPORT_EXT }}"
166-
# if-no-files-found: error
167-
# retention-days: 1
168-
#
169-
# - name: Collect and upload test coverage
170-
# uses: actions/upload-artifact@v4
171-
# if: success() || failure()
172-
# with:
173-
# name: coverage-reports-gateway
174-
# path: "**/*${{ env.COVERAGE_EXT }}"
175-
# if-no-files-found: error
176-
# retention-days: 1
177-
178-
devnet-tests:
179-
name: Cat-Gateway devnet integration tests
180-
runs-on: ubuntu-latest
181-
needs: build-images
182-
steps:
183-
- uses: actions/checkout@v4
184-
185-
- name: Install Forge
186-
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.10.0
187-
with:
188-
enable_caching: "true"
189-
version: 0.21.0
190-
191-
- name: Setup
192-
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.10.0
193-
194-
- name: Get artifacts
195-
id: get-images
196-
uses: actions/download-artifact@v4
197-
with:
198-
name: all-images
199-
path: all-images/
200-
201-
- name: Load image
202-
id: load-images
203-
run: |
204-
docker load -i ./all-images/cat-gateway.tar
205-
docker load -i ./all-images/event-db.tar
206-
docker load -i ./all-images/api-tests-runner.tar
207-
docker load -i ./all-images/schemathesis-runner.tar
208-
docker load -i ./all-images/rust-tests-runner.tar
209-
docker load -i ./all-images/event-db-v1.tar
210-
docker load -i ./all-images/haproxy-node.tar
211-
docker load -i ./all-images/cat-devnet.tar
212-
rm -rf ./all-images
213-
214-
- name: Setup SSH Agent
215-
uses: webfactory/ssh-agent@v0.9.1
216-
with:
217-
ssh-private-key: ${{ secrets.QA_REPO_SSH_KEY }}
218-
219-
- name: Prepare artifacts devnet
220-
id: images-devnet
221-
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.10.0
222-
with:
223-
command: run
224-
args: ./catalyst-gateway/tests/+images-devnet
225-
226-
- name: Spin up devnet
227-
if: ${{ steps.load-images.conclusion == 'success' }}
228-
run: |
229-
docker compose -f catalyst-gateway/tests/docker-compose-devnet.yml up cat-devnet -d
230-
231-
- name: Wait for cat-devnet to become healthy
232-
run: |
233-
echo "Waiting for container to be healthy..."
234-
for i in {1..500}; do
235-
STATUS=$(docker inspect --format='{{.State.Health.Status}}' cat-devnet)
236-
echo "Health status: $STATUS"
237-
if [ "$STATUS" == "healthy" ]; then
238-
echo "Container is healthy!"
239-
break
240-
fi
241-
if [ "$STATUS" == "unhealthy" ]; then
242-
echo "Container became unhealthy."
243-
docker compose -f catalyst-gateway/tests/docker-compose-devnet.yml logs cat-devnet
244-
exit 1
245-
fi
246-
sleep 5
247-
done
248-
249-
- name: Spin up catalyst-gateway
250-
id: gateway-started
99+
EVENT_DB_URL: "haproxy:18080"
100+
INDEX_DB_URL: "haproxy:18090"
251101
run: |
252-
docker compose -f catalyst-gateway/tests/docker-compose-devnet.yml up cat-gateway -d
102+
docker stop cat-gateway || true
103+
docker compose -f catalyst-gateway/tests/docker-compose.yml up haproxy --detach
104+
docker compose -f catalyst-gateway/tests/docker-compose.yml up cat-gateway --detach
253105
254106
- name: Wait for cat-gateway to become healthy
255-
id: gateway-healthy
256-
if: ${{ steps.gateway-started.conclusion == 'success' }}
107+
id: gateway-with-proxy-healthy
108+
if: ${{ steps.gateway-with-proxy-started.conclusion == 'success' }}
257109
run: |
258110
echo "Waiting for container to be healthy..."
259111
for i in {1..500}; do
@@ -265,138 +117,25 @@ jobs:
265117
fi
266118
if [ "$STATUS" == "unhealthy" ]; then
267119
echo "Container became unhealthy."
268-
docker compose -f catalyst-gateway/tests/docker-compose-devnet.yml logs cat-gateway
120+
docker logs cat-gateway
269121
exit 1
270122
fi
271123
sleep 5
272124
done
273125
274-
- name: Schemathesis tests
275-
if: ${{ steps.gateway-healthy.conclusion == 'success' }}
126+
- name: Integration health thru proxy tests
127+
if: ${{ steps.gateway-with-proxy-healthy.conclusion == 'success' }}
128+
env:
129+
API_TEST_MARKS: "health_with_proxy_endpoint"
276130
run: |
277-
docker compose -f catalyst-gateway/tests/docker-compose-devnet.yml up schemathesis-runner --exit-code-from schemathesis-runner
131+
docker compose -f catalyst-gateway/tests/docker-compose.yml up api-tests-runner --exit-code-from api-tests-runner
278132
279-
# ci-nightly:
280-
# uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.10.0
281-
# with:
282-
# forge_version: 0.21.0
283-
# skip_deploy: true
284-
# skip_release: true
285-
#
286-
# tests:
287-
# name: nightly tests
288-
# runs-on: ubuntu-latest
289-
# steps:
290-
# - uses: actions/checkout@v4
291-
#
292-
# - name: Free Disk Space (Ubuntu)
293-
# uses: jlumbroso/free-disk-space@main
294-
# with:
295-
# # this might remove tools that are actually needed,
296-
# # if set to "true" but frees about 6 GB
297-
# tool-cache: false
298-
# # all of these default to true, but feel free to set to
299-
# # "false" if necessary for your workflow
300-
# android: true
301-
# dotnet: false
302-
# haskell: false
303-
# large-packages: false
304-
# docker-images: false
305-
# swap-storage: true
306-
#
307-
# - name: Install Forge
308-
# uses: input-output-hk/catalyst-forge/actions/install@ci/v1.10.0
309-
# with:
310-
# enable_caching: "true"
311-
# version: 0.21.0
312-
#
313-
# - name: Setup
314-
# uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.10.0
315-
#
316-
# - name: Prepare artifacts
317-
# id : images
318-
# uses: input-output-hk/catalyst-forge/actions/run@ci/v1.10.0
319-
# with:
320-
# command: run
321-
# args: ./catalyst-gateway/tests/+all-images
322-
#
323-
# - name: Spin up catalyst-gateway
324-
# id: gateway-started
325-
# if: ${{ steps.images.conclusion == 'success' }}
326-
# run: |
327-
# docker compose -f catalyst-gateway/tests/docker-compose.yml up cat-gateway --detach
328-
#
329-
# - name: Wait for cat-gateway to become healthy
330-
# id: gateway-healthy
331-
# if: ${{ steps.gateway-started.conclusion == 'success' }}
332-
# run: |
333-
# echo "Waiting for container to be healthy..."
334-
# for i in {1..500}; do
335-
# STATUS=$(docker inspect --format='{{.State.Health.Status}}' cat-gateway)
336-
# echo "Health status: $STATUS"
337-
# if [ "$STATUS" == "healthy" ]; then
338-
# echo "Container is healthy!"
339-
# break
340-
# fi
341-
# if [ "$STATUS" == "unhealthy" ]; then
342-
# echo "Container became unhealthy."
343-
# docker logs cat-gateway
344-
# exit 1
345-
# fi
346-
# sleep 5
347-
# done
348-
#
349-
# - name: Schemathesis tests
350-
# id: schemathesis-tests
351-
# if: ${{ steps.gateway-healthy.conclusion == 'success' }}
352-
# run: |
353-
# export HYPOTHESIS_MAX_EXAMPLES=5000
354-
# export MAX_RESPONSE_TIME=25000
355-
# docker compose -f catalyst-gateway/tests/docker-compose.yml up schemathesis-runner --exit-code-from schemathesis-runner
356-
#
357-
# - name: Spin up catalyst-gateway with haproxy
358-
# id: gateway-with-proxy-started
359-
# env:
360-
# EVENT_DB_URL: "haproxy:18080"
361-
# INDEX_DB_URL: "haproxy:18090"
362-
# run: |
363-
# docker stop cat-gateway || true
364-
# docker compose -f catalyst-gateway/tests/docker-compose.yml up haproxy --detach
365-
# docker compose -f catalyst-gateway/tests/docker-compose.yml up cat-gateway --detach
366-
#
367-
# - name: Wait for cat-gateway to become healthy
368-
# id: gateway-with-proxy-healthy
369-
# if: ${{ steps.gateway-with-proxy-started.conclusion == 'success' }}
370-
# run: |
371-
# echo "Waiting for container to be healthy..."
372-
# for i in {1..500}; do
373-
# STATUS=$(docker inspect --format='{{.State.Health.Status}}' cat-gateway)
374-
# echo "Health status: $STATUS"
375-
# if [ "$STATUS" == "healthy" ]; then
376-
# echo "Container is healthy!"
377-
# break
378-
# fi
379-
# if [ "$STATUS" == "unhealthy" ]; then
380-
# echo "Container became unhealthy."
381-
# docker logs cat-gateway
382-
# exit 1
383-
# fi
384-
# sleep 5
385-
# done
386-
#
387-
# - name: Integration health thru proxy tests
388-
# if: ${{ steps.gateway-with-proxy-healthy.conclusion == 'success' }}
389-
# env:
390-
# API_TEST_MARKS: "health_with_proxy_endpoint"
391-
# run: |
392-
# docker compose -f catalyst-gateway/tests/docker-compose.yml up api-tests-runner --exit-code-from api-tests-runner
393-
#
394-
# slack-notification:
395-
# needs: tests
396-
# if: ${{ always() && needs.tests.result == 'failure' }}
397-
# uses: input-output-hk/catalyst-ci/.github/workflows/qa-notify.yml@master
398-
# with:
399-
# failed_repo: ${{ github.repository }}
400-
# failed_run_id: ${{ github.run_id }}
401-
# secrets:
402-
# slack_webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
133+
slack-notification:
134+
needs: tests
135+
if: ${{ always() && needs.tests.result == 'failure' }}
136+
uses: input-output-hk/catalyst-ci/.github/workflows/qa-notify.yml@master
137+
with:
138+
failed_repo: ${{ github.repository }}
139+
failed_run_id: ${{ github.run_id }}
140+
secrets:
141+
slack_webhook: ${{ secrets.SLACK_WEBHOOK_URL }}

0 commit comments

Comments
 (0)