Skip to content

Commit 748152a

Browse files
authored
build: added just/make startup checks in CI (#409)
* build: added just/make startup checks in CI
1 parent 4a48ef3 commit 748152a

2 files changed

Lines changed: 54 additions & 1 deletion

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)