-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.4 KB
/
Copy pathtest.yml
File metadata and controls
56 lines (46 loc) · 1.4 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
name: Flavor Tests
on:
push:
branches: [main, master]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
flavor: [vanilla, maglev]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Build ${{ matrix.flavor }} image
run: docker compose build
env:
JR8_FLAVOR: ${{ matrix.flavor }}
- name: Start ${{ matrix.flavor }} app
run: docker compose up -d
env:
JR8_FLAVOR: ${{ matrix.flavor }}
- name: Wait for app to be available (up to 8 min)
timeout-minutes: 8
run: |
until curl -sf http://localhost:3008 -o /dev/null; do
sleep 5
done
- name: Root page returns HTTP 200
run: |
STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:3008)
echo "HTTP status: $STATUS"
[ "$STATUS" = "200" ]
- name: Maglev editor is accessible
if: matrix.flavor == 'maglev'
run: |
STATUS=$(curl -s -o /dev/null -w "%{http_code}" -L http://localhost:3008/maglev)
echo "Maglev editor HTTP status: $STATUS"
[ "$STATUS" = "200" ] || [ "$STATUS" = "302" ]
- name: Show logs on failure
if: failure()
run: docker compose logs
- name: Stop containers
if: always()
run: docker compose down -v