-
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (79 loc) · 2.58 KB
/
php.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
name: IDMarinas Template Symfony Test Suite
on:
pull_request:
branches: [ master ]
types: [ opened, synchronize, reopened ]
tags-ignore: [ dependencies, documentation, meta, 'docker configuration', 'deployer configuration' ]
push:
branches: [ master ]
paths-ignore:
- '.deployer/**'
- '.docker/**'
- '.idea/**'
- 'migrations/**'
- '**/docs/**'
- '**/Writerside/**'
- '**/README.md'
- '**/COMMANDS.md'
- '**/TIPS.md'
- '**/TODO.md'
- '**/LICENSE'
- rector.php
- .editorconfig
- .gitignore
- compose.yaml
jobs:
build:
runs-on: ubuntu-latest
name: PHP ${{ matrix.php }} and Symfony ${{ matrix.symfony }}
strategy:
matrix:
php: [ '8.4' ]
symfony: [ '7.2.*' ]
services:
database_test:
image: mariadb:11.4.4
env:
DATABASE_HOST: 127.0.0.1
MARIADB_AUTO_UPGRADE: true
MARIADB_DATABASE: database_db_test
MARIADB_USER: database_user_test
MARIADB_PASSWORD: '!ChangeMe!'
MARIADB_ROOT_PASSWORD: '!ChangeMe!'
ports:
- 3306:3306
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
- uses: actions/checkout@v4
with:
fetch-depth: ${{ (matrix.php == '8.4' && matrix.symfony == '7.2.*') && '0' || '1' }}
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: flex
- name: Download dependencies
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}
uses: ramsey/composer-install@v3
- name: Built Tailwind CSS files
run: 'php bin/console tailwind:build'
- name: Create Database
run: 'php bin/console doctrine:schema:create --env=test && php bin/console doctrine:fixtures:load --env=test -n'
env:
DATABASE_HOST: 127.0.0.1
- name: Run test suite on PHP ${{ matrix.php }} and Symfony ${{ matrix.symfony }}
run: ./vendor/bin/phpunit --exclude ignore
env:
DATABASE_HOST: 127.0.0.1
# # Uncomment to activate SonarCloud Scan
# - name: SonarCloud Scan
# if: matrix.php == '8.4' && matrix.symfony == '7.2.*'
# uses: SonarSource/sonarqube-scan-action@v4
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}