-
Notifications
You must be signed in to change notification settings - Fork 3
70 lines (67 loc) · 2.11 KB
/
docker-e2e.yaml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Docker e2e Test
on:
pull_request: {}
env:
IMAGE_REGISTRY: ghcr.io
IMAGE_PATH: ${{ github.repository }}
IMAGE_TAG: ${{ github.ref_name }}
jobs:
e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Image
uses: docker/build-push-action@v6
with:
push: false
load: true
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_PATH }}:latest
- name: Create Environment
run: |
cat > .env << EOF
APP_NAME="Erstiwoche FB5"
APP_ENV=local
APP_KEY=1234567890ABCDEFGHIJ1234567890AB
APP_DEBUG=true
APP_URL=http://localhost
APP_FORCE_HTTPS=false
APP_EVENT_TYPE=demo
TUTOR_PASSWORD=password
ADMIN_PASSWORD=admin
LOG_CHANNEL=stack
LOG_LEVEL=debug
BROADCAST_CONNECTION=log
CACHE_STORE=file # TODO
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file # TODO
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
OCTANE_HTTPS=false
OCTANE_WORKERS=1
OCTANE_MAX_REQUESTS=512
WWWGROUP=1000
WWWUSER=1000
OCTANE_SERVER=roadrunner
EOF
- name: Run Image
uses: isbang/compose-action@v2.0.1
with:
compose-file: "docker-compose.yaml"
down-flags: "--volumes"
- name: Wait
run: |
# wait 10 seconds for the docker container to start
sleep 10
- name: Run DB Seed
run: |
# run "php artisan migrate:fresh --seed" inside docker container
docker exec strichlistensystem-web php artisan migrate:fresh --seed
- name: Debug
run: |
curl http://localhost:8000
- name: Test reachable
run: |
# test every 10 seconds if http://localhost:8000 is reachable and has a OK status code. Timeout after 2 minutes
timeout 120 bash -c 'until curl --output /dev/null --silent --head --fail http://localhost:8000; do printf "."; sleep 10; done'