-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (117 loc) · 4.24 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
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