Skip to content

Merge pull request #21 from bakaphp/feat-find-cobuyer #121

Merge pull request #21 from bakaphp/feat-find-cobuyer

Merge pull request #21 from bakaphp/feat-find-cobuyer #121

Workflow file for this run

name: "Tests"
on: [push, pull_request]
jobs:
run-tests:
name: PHP ${{ matrix.php-versions }}
runs-on: ubuntu-18.04
env:
extensions: mbstring, intl, json, phalcon4, redis, swoole, xdebug
key: cache-v0.0.2
DATA_API_MYSQL_HOST: 127.0.0.1
DATA_API_MYSQL_USER: root
DATA_API_MYSQL_PASS: password
DATA_API_MYSQL_NAME: bakatest
DATA_API_MEMCACHED_HOST: 127.0.0.1
DATA_API_MEMCACHED_PORT: 11211
DATA_API_MEMCACHED_WEIGHT: 100
VINSOLUTIONS_CLIENT_ID: ${{ secrets.VINSOLUTIONS_CLIENT_ID }}
VINSOLUTIONS_CLIENT_SECRET: ${{ secrets.VINSOLUTIONS_CLIENT_SECRET }}
VINSOLUTIONS_API_KEY: ${{ secrets.VINSOLUTIONS_API_KEY }}
VINSOLUTIONS_API_KEY_DIGITAL_SHOWROOM: ${{ secrets.VINSOLUTIONS_API_KEY_DIGITAL_SHOWROOM }}
VINSOLUTIONS_DEALER_ID: ${{ secrets.VINSOLUTIONS_DEALER_ID }}
VINSOLUTIONS_USER_ID: ${{ secrets.VINSOLUTIONS_USER_ID }}
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
ELASTIC_HOST: 127.0.0.1:9200
APP_IP: api.baka.ld
APP_ENV: development
PHINX_CONFIG_DIR: storage
services:
mysql:
image: mariadb:10.4
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: bakatest
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
rabbitmq:
image: rabbitmq
ports:
- 5672:5672
memcached:
image: memcached
ports:
- "11211:11211"
strategy:
fail-fast: false
matrix:
php-versions: ['7.4']
steps:
- uses: actions/checkout@v1
- name: Setup cache environment
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Cache extensions
uses: actions/cache@v1
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
tools: pecl
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --prefer-dist --no-suggest
- name: Update Composer dependencies
run: composer update --prefer-dist --no-suggest
- name: Setup Env Variable
run: cp .env.example .env
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Set up ES and install SQL plugin
run: |
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt update
sudo apt install openjdk-11-jdk
sudo apt install unzip
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-7.8.0-amd64.deb
sudo dpkg -i elasticsearch-oss-7.8.0-amd64.deb
sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-sql/opendistro_sql-1.9.0.0.zip
sudo systemctl start elasticsearch.service
- name: Run all integration test suites
if: success()
run: |
vendor/bin/codecept run -v