murph-skeleton/.woodpecker.yml

63 lines
1.8 KiB
YAML
Raw Normal View History

2023-01-08 21:48:56 +01:00
matrix:
PHP_VERSION:
# - 8.0
2023-01-08 21:48:56 +01:00
- 8.1
services:
db:
image: mariadb:10.3
environment:
- MARIADB_ROOT_PASSWORD=root
pipeline:
wait_db:
image: gitnet.fr/deblan/timeout:latest
commands:
- /bin/timeout -t 30 -v -c 'while true; do nc -z -v db 3306 2>&1 | grep succeeded && exit 0; sleep 0.5; done'
create_db:
image: mariadb:10.3
commands:
- mysql -hdb -uroot -proot -e "CREATE DATABASE app"
2023-01-09 09:59:21 +01:00
- mysql -hdb -uroot -proot -e "CREATE DATABASE app_test"
2023-01-08 21:48:56 +01:00
config:
2023-01-09 22:52:24 +01:00
image: deblan/php:8.1
2023-01-08 21:48:56 +01:00
commands:
- echo APP_ENV=prod >> .env.local
- echo APP_SECRET=$(openssl rand -hex 32) >> .env.local
- echo DATABASE_URL=mysql://root:root@db/app >> .env.local
2023-01-09 10:09:05 +01:00
- echo DATABASE_URL=mysql://root:root@db/app_test >> .env.test.local
2023-01-08 21:48:56 +01:00
composer:
2023-01-09 22:52:24 +01:00
image: deblan/php:${PHP_VERSION}
2023-01-08 21:48:56 +01:00
commands:
- apt-get update && apt-get -y install git
- composer install --no-scripts
migrate:
2023-01-09 22:52:24 +01:00
image: deblan/php:${PHP_VERSION}
2023-01-08 21:48:56 +01:00
environment:
- PHP=php
commands:
- ./bin/doctrine-migrate
node:
image: node:16-slim
commands:
- yarn
- test -d public/js || mkdir public/js
2023-01-08 21:48:56 +01:00
- test -f public/js/fos_js_routes.json || echo "{}" > public/js/fos_js_routes.json
- npm run build
tests:
2023-01-09 22:52:24 +01:00
image: deblan/php:${PHP_VERSION}
2023-01-08 21:48:56 +01:00
commands:
2023-01-10 10:23:14 +01:00
- apt-get update && apt-get install -y unzip libnss3
2023-01-09 10:20:19 +01:00
- composer install --no-scripts --dev
2023-01-10 10:30:03 +01:00
- curl -o chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/108.0.5359.71/chromedriver_linux64.zip && unzip -d drivers chromedriver_linux64.zip
- curl -o /tmp/chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && apt install /tmp/chrome.deb
2023-01-09 09:49:30 +01:00
- vendor/bin/bdi detect drivers
- symfony server:start --port=9080 --no-tls -d
2023-01-08 21:48:56 +01:00
- php bin/phpunit