-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (43 loc) · 1.31 KB
/
docker-smoke-test.yaml
File metadata and controls
51 lines (43 loc) · 1.31 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
name: docker-smoke-test
on:
pull_request:
jobs:
docker:
name: Docker (${{ matrix.runtime }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
include:
- runtime: bun
dockerfile: docker-tests/Dockerfile.bun
- runtime: node
dockerfile: docker-tests/Dockerfile.node
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build image
run: docker build -f ${{ matrix.dockerfile }} -t chronicle-${{ matrix.runtime }} .
- name: Run container
run: docker run -d --name chronicle-${{ matrix.runtime }} -p 3000:3000 chronicle-${{ matrix.runtime }}
- name: Wait for server
run: |
for i in $(seq 1 30); do
if curl -sf http://localhost:3000/api/ready > /dev/null 2>&1; then
echo "Server ready"
exit 0
fi
sleep 2
done
echo "Server failed to start"
docker logs chronicle-${{ matrix.runtime }}
exit 1
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24
- name: Smoke tests
run: node docker-tests/smoke-test.mjs
- name: Cleanup
if: always()
run: docker rm -f chronicle-${{ matrix.runtime }} || true