File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Startup Sanity Check
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+
9+ jobs :
10+ startup-check :
11+ runs-on : ubuntu-latest
12+ strategy :
13+ matrix :
14+ tool : [just, make]
15+ mode : [up, up_monitoring]
16+ name : Startup Test (${{ matrix.tool }} ${{ matrix.mode }})
17+ steps :
18+ - name : Checkout code
19+ uses : actions/checkout@v4
20+
21+ - name : Install ${{ matrix.tool }}
22+ run : |
23+ sudo apt update
24+ sudo apt install -y ${{ matrix.tool }}
25+
26+ - name : Prepare environment file
27+ run : cp .env.dist .env
28+
29+ - name : Build and start stack
30+ run : ${{ matrix.tool }} ${{ matrix.mode }}
31+
32+ - name : Wait for all containers to be healthy
33+ run : |
34+ tries=0
35+ max=24
36+ while [ "$(docker ps --filter health=starting --format '{{.ID}}' | wc -l)" -gt 0 ]; do
37+ tries=$((tries+1))
38+ if [ "$tries" -ge "$max" ]; then
39+ echo "Timed out waiting for healthy containers" >&2
40+ docker ps
41+ exit 1
42+ fi
43+ sleep 5
44+ done
45+ unhealthy=$(docker ps --filter 'health=unhealthy' -q)
46+ if [ -n "$unhealthy" ]; then
47+ echo "Unhealthy containers detected!" >&2
48+ docker ps
49+ exit 1
50+ fi
51+
52+ - name : Tear down containers
53+ run : ${{ matrix.tool }} down
You can’t perform that action at this time.
0 commit comments