-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (34 loc) · 1.18 KB
/
smoke-test.yml
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
name: Smoke test with wis2box stack
on: [ push, pull_request ]
jobs:
smoke-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build Docker image
run: docker build -t wis2box-webapp .
- name: Start Docker Compose services
working-directory: tests
run: docker compose -f docker-compose.yml up -d --build
- name: check status
run: docker ps -a
- name: Wait for service to start
run: sleep 30
- name: check logs wis2box-webapp
run: docker logs wis2box-webapp-test
- name: Check status code
run: |
curl -s -o /dev/null -w "%{http_code}" http://localhost:4173/wis2box-webapp/
status_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:4173/wis2box-webapp/)
if [[ $status_code -ne 200 ]]; then
echo "Request failed with status code:"
echo ${status_code}
exit 1
fi
- name: failed tests 🚩
working-directory: tests
if: ${{ failure() }}
run: |
echo "check docker logs"
docker compose -f docker-compose.yml logs