-
Notifications
You must be signed in to change notification settings - Fork 23
53 lines (46 loc) · 1.35 KB
/
Copy pathci-startup-check.yml
File metadata and controls
53 lines (46 loc) · 1.35 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
name: Startup Sanity Check
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
startup-check:
runs-on: ubuntu-latest
strategy:
matrix:
tool: [just, make]
mode: [up, up_monitoring]
name: Startup Test (${{ matrix.tool }} ${{ matrix.mode }})
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install ${{ matrix.tool }}
run: |
sudo apt update
sudo apt install -y ${{ matrix.tool }}
- name: Prepare environment file
run: cp .env.dist .env
- name: Build and start stack
run: ${{ matrix.tool }} ${{ matrix.mode }}
- name: Wait for all containers to be healthy
run: |
tries=0
max=24
while [ "$(docker ps --filter health=starting --format '{{.ID}}' | wc -l)" -gt 0 ]; do
tries=$((tries+1))
if [ "$tries" -ge "$max" ]; then
echo "Timed out waiting for healthy containers" >&2
docker ps
exit 1
fi
sleep 5
done
unhealthy=$(docker ps --filter 'health=unhealthy' -q)
if [ -n "$unhealthy" ]; then
echo "Unhealthy containers detected!" >&2
docker ps
exit 1
fi
- name: Tear down containers
run: ${{ matrix.tool }} down