-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (87 loc) · 4.07 KB
/
laravel.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
name: Full CI process for Symfony 5
on:
push:
branches:
- master
env:
ES_HTTP_PORT: 9209
jobs:
symfony:
name: Symfony 5.0 (PHP ${{ matrix.php-versions }})
# https://hub.docker.com/_/ubuntu/
runs-on: ubuntu-18.04
services:
# https://docs.docker.com/samples/library/mysql/
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
# https://hub.docker.com/_/elasticsearch/
elasticsearch:
image: elasticsearch:6.8.6
ports:
- 9209:9200
options: -e="discovery.type=single-node" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
strategy:
fail-fast: true
matrix:
php-versions: ['7.2', '7.4']
steps:
# —— Check Elasticsearch 🔎 ——————————————————————————————————————————————
- name: Check the Elasticsearch connection from runner host
run: |
curl -fsSL "http://localhost:$ES_HTTP_PORT"
curl -fsSL "http://localhost:$ES_HTTP_PORT/_cluster/health?pretty"
# —— Setup Github actions 🐙 —————————————————————————————————————————————
# https://github.com/actions/checkout (official)
- name: Checkout
uses: actions/checkout@v2
# https://github.com/shivammathur/setup-php (community)
- name: Setup PHP, extensions and composer with shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, dom, filter, gd, iconv, json, mbstring, pdo
env:
update: true
# https://github.com/zhulik/redis-action (community)
- name: Setup Redis with zhulik/redis-action
uses: zhulik/[email protected]
with:
redis version: '5'
# —— Composer 🧙️ —————————————————————————————————————————————————————————
- name: Validate composer.json and composer.lock
run: composer validate
- 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: make install
# —— Symfony 🎵 ——————————————————————————————————————————————————————————
- name: Check Symfony requirements
run: vendor/bin/requirements-checker
- name: Check the Symfony console
run: |
php bin/console -V
php bin/console strangebuzz:version
## —— Coding standards ✨ ————————————————————————————————————————————————
- name: Coding standards checks (php_codesniffer + PHPStan)
run: make cs
## —— Tests ✅ ———————————————————————————————————————————————————————————
- name: Load Doctrine fixtures and populate the Elasticsearch indexes
run: |
make load-fixtures
make populate
- name: Run functionnal and unit tests
run: |
cp phpunit.xml.ci phpunit.xml
make test