-
Notifications
You must be signed in to change notification settings - Fork 12
142 lines (126 loc) · 4.64 KB
/
nightly-ci.yml
File metadata and controls
142 lines (126 loc) · 4.64 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
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
name: CI nightly
on:
schedule:
- cron: '0 0 * * *' # Runs every day at 00:00
workflow_dispatch:
permissions:
id-token: write
contents: write
packages: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
ci-nightly:
uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.10.0
with:
forge_version: 0.21.0
skip_deploy: true
skip_release: true
tests:
name: nightly tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: false
haskell: false
large-packages: false
docker-images: false
swap-storage: true
- name: Install Forge
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.10.0
with:
enable_caching: "true"
version: 0.21.0
- name: Setup
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.10.0
- name: Prepare artifacts
id : images
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.10.0
with:
command: run
args: ./catalyst-gateway/tests/+all-images
- name: Spin up catalyst-gateway
id: gateway-started
if: ${{ steps.images.conclusion == 'success' }}
run: |
docker compose -f catalyst-gateway/tests/docker-compose.yml up cat-gateway --detach
- name: Wait for cat-gateway to become healthy
id: gateway-healthy
if: ${{ steps.gateway-started.conclusion == 'success' }}
run: |
echo "Waiting for container to be healthy..."
for i in {1..500}; do
STATUS=$(docker inspect --format='{{.State.Health.Status}}' cat-gateway)
echo "Health status: $STATUS"
if [ "$STATUS" == "healthy" ]; then
echo "Container is healthy!"
break
fi
if [ "$STATUS" == "unhealthy" ]; then
echo "Container became unhealthy."
docker logs cat-gateway
exit 1
fi
sleep 5
done
- name: Schemathesis tests
id: schemathesis-tests
if: ${{ steps.gateway-healthy.conclusion == 'success' }}
run: |
export HYPOTHESIS_MAX_EXAMPLES=5000
export MAX_RESPONSE_TIME=25000
export HYPOTHESIS_DEADLINE=25000
docker compose -f catalyst-gateway/tests/docker-compose.yml up schemathesis-runner --exit-code-from schemathesis-runner
- name: Spin up catalyst-gateway with haproxy
id: gateway-with-proxy-started
env:
EVENT_DB_URL: "haproxy:18080"
INDEX_DB_URL: "haproxy:18090"
run: |
docker stop cat-gateway || true
docker compose -f catalyst-gateway/tests/docker-compose.yml up haproxy --detach
docker compose -f catalyst-gateway/tests/docker-compose.yml up cat-gateway --detach
- name: Wait for cat-gateway to become healthy
id: gateway-with-proxy-healthy
if: ${{ steps.gateway-with-proxy-started.conclusion == 'success' }}
run: |
echo "Waiting for container to be healthy..."
for i in {1..500}; do
STATUS=$(docker inspect --format='{{.State.Health.Status}}' cat-gateway)
echo "Health status: $STATUS"
if [ "$STATUS" == "healthy" ]; then
echo "Container is healthy!"
break
fi
if [ "$STATUS" == "unhealthy" ]; then
echo "Container became unhealthy."
docker logs cat-gateway
exit 1
fi
sleep 5
done
- name: Integration health thru proxy tests
if: ${{ steps.gateway-with-proxy-healthy.conclusion == 'success' }}
env:
API_TEST_MARKS: "health_with_proxy_endpoint"
run: |
docker compose -f catalyst-gateway/tests/docker-compose.yml up api-tests-runner --exit-code-from api-tests-runner
slack-notification:
needs: tests
if: ${{ always() && needs.tests.result == 'failure' }}
uses: input-output-hk/catalyst-ci/.github/workflows/qa-notify.yml@master
with:
failed_repo: ${{ github.repository }}
failed_run_id: ${{ github.run_id }}
secrets:
slack_webhook: ${{ secrets.SLACK_WEBHOOK_URL }}