From 518c98710eae700748762838327c0f517b3ec6ba Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 21:48:56 +0100 Subject: [PATCH] feat(ci): add base of CI --- .woodpecker.yml | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..708c540 --- /dev/null +++ b/.woodpecker.yml @@ -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