Skip to content

Commit 0ee8c96

Browse files
Create laravel.yml
1 parent 58483df commit 0ee8c96

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed

.github/workflows/laravel.yml

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Full CI process for Symfony 5
2+
on:
3+
push:
4+
branches:
5+
- master
6+
env:
7+
ES_HTTP_PORT: 9209
8+
jobs:
9+
symfony:
10+
name: Symfony 5.0 (PHP ${{ matrix.php-versions }})
11+
# https://hub.docker.com/_/ubuntu/
12+
runs-on: ubuntu-18.04
13+
services:
14+
# https://docs.docker.com/samples/library/mysql/
15+
mysql:
16+
image: mysql:5.7
17+
env:
18+
MYSQL_ROOT_PASSWORD: root
19+
ports:
20+
- 3306:3306
21+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
22+
# https://hub.docker.com/_/elasticsearch/
23+
elasticsearch:
24+
image: elasticsearch:6.8.6
25+
ports:
26+
- 9209:9200
27+
options: -e="discovery.type=single-node" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
28+
strategy:
29+
fail-fast: true
30+
matrix:
31+
php-versions: ['7.2', '7.4']
32+
steps:
33+
# —— Check Elasticsearch 🔎 ——————————————————————————————————————————————
34+
- name: Check the Elasticsearch connection from runner host
35+
run: |
36+
curl -fsSL "http://localhost:$ES_HTTP_PORT"
37+
curl -fsSL "http://localhost:$ES_HTTP_PORT/_cluster/health?pretty"
38+
39+
# —— Setup Github actions 🐙 —————————————————————————————————————————————
40+
# https://github.com/actions/checkout (official)
41+
- name: Checkout
42+
uses: actions/checkout@v2
43+
44+
# https://github.com/shivammathur/setup-php (community)
45+
- name: Setup PHP, extensions and composer with shivammathur/setup-php
46+
uses: shivammathur/setup-php@v2
47+
with:
48+
php-version: ${{ matrix.php-versions }}
49+
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, dom, filter, gd, iconv, json, mbstring, pdo
50+
env:
51+
update: true
52+
53+
# https://github.com/zhulik/redis-action (community)
54+
- name: Setup Redis with zhulik/redis-action
55+
uses: zhulik/[email protected]
56+
with:
57+
redis version: '5'
58+
59+
# —— Composer 🧙‍️ —————————————————————————————————————————————————————————
60+
- name: Validate composer.json and composer.lock
61+
run: composer validate
62+
63+
- name: Get composer cache directory
64+
id: composer-cache
65+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
66+
67+
- name: Cache composer dependencies
68+
uses: actions/cache@v1
69+
with:
70+
path: ${{ steps.composer-cache.outputs.dir }}
71+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
72+
restore-keys: ${{ runner.os }}-composer-
73+
74+
- name: Install Composer dependencies
75+
run: make install
76+
77+
# —— Symfony 🎵 ——————————————————————————————————————————————————————————
78+
- name: Check Symfony requirements
79+
run: vendor/bin/requirements-checker
80+
81+
- name: Check the Symfony console
82+
run: |
83+
php bin/console -V
84+
php bin/console strangebuzz:version
85+
86+
## —— Coding standards ✨ ————————————————————————————————————————————————
87+
- name: Coding standards checks (php_codesniffer + PHPStan)
88+
run: make cs
89+
90+
## —— Tests ✅ ———————————————————————————————————————————————————————————
91+
- name: Load Doctrine fixtures and populate the Elasticsearch indexes
92+
run: |
93+
make load-fixtures
94+
make populate
95+
96+
- name: Run functionnal and unit tests
97+
run: |
98+
cp phpunit.xml.ci phpunit.xml
99+
make test

0 commit comments

Comments
 (0)