Prepare GH Action and Pest

This commit is contained in:
Joao Patricio 2023-03-29 16:39:08 +01:00
parent 0b248e9be4
commit 845ca5c6b3
2 changed files with 34 additions and 36 deletions

View File

@ -13,17 +13,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: |
docker run --rm -u "$(id -u):$(id -g)" \
-v "$(pwd):/app" \
-w /app composer:2 \
composer install --ignore-platform-reqs
TAG=$(date +%s) ./vendor/bin/sail build
TAG=$(date +%s) ./vendor/bin/sail up -d
sleep 1
./vendor/bin/sail ps
# Now to create .env
# Await database is created
# pest
- uses: actions/checkout@v3
- name: Build the Docker image
run: |
cp .env.example .env
docker run --rm -u "$(id -u):$(id -g)" \
-v "$(pwd):/app" \
-w /app composer:2 \
composer install --ignore-platform-reqs
./vendor/bin/sail build
./vendor/bin/sail up -d
./vendor/bin/sail artisan key:generate
./vendor/bin/sail artisan migrate:fresh --seed
./vendor/bin/pest

View File

@ -1,4 +1,16 @@
version: '3.8'
x-testing-host: &testing-host-base
image: coolify-testing-host
build:
dockerfile: Dockerfile
context: ./docker/testing-host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./docker/testing-host/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf
networks:
- coolify
services:
php:
image: "coolify:${TAG:-4}"
@ -19,6 +31,9 @@ services:
- .:/var/www/html
networks:
- coolify
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:15-alpine
ports:
@ -36,34 +51,18 @@ services:
test:
[
"CMD-SHELL",
"pg_isready -U $$DB_USERNAME",
"pg_isready -U coolify",
"-d",
"db_prod"
"coolify"
]
retries: 3
timeout: 5s
retries: 5
timeout: 10s
testing-host:
<<: *testing-host-base
container_name: coolify-testing-host
image: coolify-testing-host
build:
dockerfile: Dockerfile
context: ./docker/testing-host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./docker/testing-host/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf
networks:
- coolify
testing-host2:
<<: *testing-host-base
container_name: coolify-testing-host-2
image: coolify-testing-host
build:
dockerfile: Dockerfile
context: ./docker/testing-host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./docker/testing-host/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf
networks:
- coolify
volumes:
db-coolify: