Commit f0911c8e authored by Cédric Girardot's avatar Cédric Girardot
Browse files

CI : WIP ajoute les tests unitaires

Change-Id: I6019339769acfbb104ca157fc9af928ef663ef67
parent d05ba297
Pipeline #10514 passed with stages
in 9 minutes
......@@ -8,15 +8,15 @@ include:
- project: 'adullact/partage-gitlab-ci'
ref: master
file: '/templates/docker/kaniko/.gitlab-ci.template.yml'
- project: 'adullact/partage-gitlab-ci'
- project: 'atol-cd/partage-gitlab-ci'
ref: master
file: '/templates/composer/.gitlab-ci.template.yml'
stages:
- pre-build
- pre-build-test
- build
- test
- build
- package
- deliver
......@@ -24,9 +24,40 @@ get-version:
stage: pre-build
extends: .get-version-git-template
test-app:
stage: test
extends: .composer-yarn-build-template
services:
- mariadb:10.1
variables:
MYSQL_DATABASE: notaires
MYSQL_ROOT_PASSWORD: password
ADU_CI_COMPOSER_PROJECT_DIR: "$CI_PROJECT_DIR/appli_sf"
ADU_CI_COMPOSER_CLI_OPTIONS: "--no-progress --no-suggest --no-interaction --no-scripts"
script:
- |
VERSION=$(cat "$CI_PROJECT_DIR/$ADU_CI_APP_VERSION_FILE")
cd $ADU_CI_COMPOSER_PROJECT_DIR
cp .env.dist .env
sed -i "s#DATABASE_URL=\"mysqli://notaires:password@127.0.0.1:3306/notaires\"#DATABASE_URL=\"mysqli://root:password@mariadb:3306/notaires\"#" .env
sed -i "s#mysqli://notaires:password@database:3306/notaires#mysqli://root:password@mariadb:3306/notaires#" phpunit.xml.dist
composer install $ADU_CI_COMPOSER_CLI_OPTIONS
yarn install --frozen-lockfile
yarn run build
bin/console doctrine:schema:update --force
bin/console cache:clear
bin/console lint:yaml --no-interaction config
bin/console lint:yaml --no-interaction translations
./vendor/bin/phpcs
./vendor/bin/phplint --no-progress --no-interaction
./vendor/bin/phpstan analyse --no-progress --no-interaction
bin/phpunit tests/UnitTests
build-app:
stage: build
extends: .composer-yarn-build-template
variables:
ADU_CI_COMPOSER_PROJECT_DIR: "$CI_PROJECT_DIR/appli_sf"
ARCHIVE_FILES: >-
......@@ -52,6 +83,7 @@ build-app:
composer install $ADU_CI_COMPOSER_CLI_OPTIONS
yarn install --frozen-lockfile
yarn run build
mkdir "$CI_PROJECT_DIR/build-result"
tar cvzf "$CI_PROJECT_DIR/build-result/app-$VERSION.tgz" $ARCHIVE_FILES > "$CI_PROJECT_DIR/tar-result.txt"
echo "$(cat "$CI_PROJECT_DIR/tar-result.txt" | wc -l) files added"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment