feat(ci): add base of CI

This commit is contained in:
Simon Vieille 2023-01-08 21:48:56 +01:00
parent 9937160ae0
commit 518c98710e
Signed by: deblan
GPG key ID: 579388D585F70417

55
.woodpecker.yml Normal file
View file

@ -0,0 +1,55 @@
matrix:
PHP_VERSION:
- 8.0
- 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"
config:
image: deblan/php:8.1
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
composer:
image: deblan/php:${PHP_VERSION}
commands:
- apt-get update && apt-get -y install git
- composer install --no-scripts
migrate:
image: deblan/php:${PHP_VERSION}
environment:
- PHP=php
commands:
- ./bin/doctrine-migrate
node:
image: node:16-slim
commands:
- yarn
- test -f public/js/fos_js_routes.json || echo "{}" > public/js/fos_js_routes.json
- npm run build
tests:
image: deblan/php:${PHP_VERSION}
environment:
- APP_ENV=test
commands:
- php bin/phpunit