|
| 1 | +# PHP CircleCI 2.0 configuration file |
| 2 | +# |
| 3 | +# Check https://circleci.com/docs/2.0/language-php/ for more details |
| 4 | +# |
| 5 | +version: 2 |
| 6 | +machine: |
| 7 | + # Override /etc/hosts |
| 8 | + hosts: |
| 9 | + localhost: 127.0.0.1 |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + docker: |
| 13 | + # Specify the version you desire here |
| 14 | + - image: cimg/php:8.3.3 |
| 15 | + environment: |
| 16 | + working_directory: ~/genealogy |
| 17 | + DB_CONNECTION: mysql |
| 18 | + DB_HOST: 127.0.0.1 |
| 19 | + DB_PORT: 3306 |
| 20 | + |
| 21 | + # Specify service dependencies here if necessary |
| 22 | + # CircleCI maintains a library of pre-built images |
| 23 | + # documented at https://circleci.com/docs/2.0/circleci-images/ |
| 24 | + # Using the RAM variation mitigates I/O contention |
| 25 | + # for database intensive operations. |
| 26 | + - image: circleci/mysql:latest-ram |
| 27 | + # command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --innodb-large-prefix=true --innodb-file-format=Barracuda |
| 28 | + command: mysqld |
| 29 | + environment: |
| 30 | + MYSQL_USER: liberu |
| 31 | + MYSQL_PASSWORD: password |
| 32 | + MYSQL_ALLOW_EMPTY_PASSWORD: true |
| 33 | + MYSQL_ROOT_HOST: "%" |
| 34 | + DB_HOST: 127.0.0.1 |
| 35 | + DB_PORT: 3306 |
| 36 | + working_directory: ~/genealogy |
| 37 | + # - image: redis:2.8.19 |
| 38 | + steps: |
| 39 | + - checkout |
| 40 | + #- setup_remote_docker: |
| 41 | + # docker_layer_caching: true |
| 42 | + # - run: docker-build |
| 43 | + - run: sudo apt-get update |
| 44 | + - run: sudo apt-get install lsb-release |
| 45 | + - run: sudo apt update # PHP CircleCI 2.0 Configuration File# PHP CircleCI 2.0 Configuration File sudo apt install zlib1g-dev libsqlite3-dev |
| 46 | + - run: sudo apt install -y default-mysql-client libxml2-dev libpng-dev |
| 47 | + libfreetype6-dev libpng-dev libjpeg-dev libjpeg-turbo8-dev libzip-dev |
| 48 | + #- run: sudo docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-webp-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \ |
| 49 | + - run: sudo docker-php-ext-configure gd --with-freetype --with-jpeg |
| 50 | + - run: sudo docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd |
| 51 | + - run: sudo docker-php-ext-install zip pdo_mysql bcmath pcntl soap gd |
| 52 | + |
| 53 | + #- run: pecl install xdebug && docker-php-ext-enable xdebug |
| 54 | + # - run: docker-php-ext-enable xdebug |
| 55 | + |
| 56 | + # Download and cache dependencies |
| 57 | + - restore_cache: |
| 58 | + keys: |
| 59 | + # "composer.lock" can be used if it is committed to the repo |
| 60 | + - v1-dependencies-{{ checksum "composer.json" }} |
| 61 | + # fallback to using the latest cache if no exact match is found |
| 62 | + - v1-dependencies- |
| 63 | + - run: composer clearcache |
| 64 | + - run: sudo composer selfupdate |
| 65 | + - run: composer install -n --prefer-dist |
| 66 | + - save_cache: |
| 67 | + key: v1-dependencies-{{ checksum "composer.json" }} |
| 68 | + paths: |
| 69 | + - ./vendor |
| 70 | + - run: |
| 71 | + name: Mysql database |
| 72 | + command: mysql -h 127.0.0.1 -u root -e "create database liberu;" |
| 73 | + # - run: sudo echo "localhost 127.0.0.1" >> /etc/hosts |
| 74 | + - run: cp .env.testing .env |
| 75 | + - run: php artisan key:generate |
| 76 | + - run: php artisan migrate --seed |
| 77 | + - run: mkdir -p build/logs |
| 78 | + # - run: php artisan test |
| 79 | + - run: vendor/bin/phpunit |
| 80 | + # The resource_class feature allows configuring CPU and RAM resources for each job. Different resource classes are available for different executors. https://circleci.com/docs/2.0/configuration-reference/#resourceclass |
| 81 | + resource_class: large |
| 82 | + |
| 83 | +# - run: mkdir -p ~/phpunit |
| 84 | +# - run: vendor/bin/phpunit --log-junit ~/phpunit/junit.xml tests |
| 85 | +# store_test_results: |
| 86 | +# path: ~/phpunit |
0 commit comments