-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (60 loc) · 2.38 KB
/
ci.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
name: Symfony with MySQL
on: [push, pull_request]
jobs:
symfony:
name: Symfony
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: symfony
MYSQL_DATABASE: symfony
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: '7.4'
extensions: imagick, mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql
coverage: xdebug #optional
- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Setup NodeJS & Yarn
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: |
composer install --no-progress --prefer-dist --optimize-autoloader
- name: Run Migration & data fixtures
run: |
php bin/console doctrine:schema:update --force || echo "No migrations found or schema update failed"
php bin/console doctrine:migrations:migrate -n || echo "No migrations found or migration failed"
php bin/console doctrine:fixtures:load -n
env:
DATABASE_URL: mysql://root:[email protected]:${{ job.services.mysql.ports['3306'] }}/symfony
- name: Install Yarn dependencies and CSS/JS assets
run: |
yarn install
yarn encore production
- name: Run Tests
run: php vendor/bin/phpunit --coverage-clover coverage.xml
env:
DATABASE_URL: mysql://root:[email protected]:${{ job.services.mysql.ports['3306'] }}/symfony
- name: Upload coverage report
run: bash <(curl -s https://codecov.io/bash)