-
Notifications
You must be signed in to change notification settings - Fork 2
121 lines (94 loc) · 3.49 KB
/
symfony.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
name: Fireping CI/CD
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
DATABASE_URL: mysql://[email protected]:3306/fireping_test
RRDCACHED_TEST: 127.0.0.1:42217
XDEBUG_MODE: coverage
SYMFONY_DEPRECATIONS_HELPER: max[direct]=0
jobs:
symfony:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php-versions: ['8.1', '8.2']
services:
# https://docs.docker.com/samples/library/mysql/
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: fireping_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Install packages
run: sudo apt-get install librrd-dev rrdtool fping
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, rrd
coverage: pcov
tools: pecl
- name: Start Redis
uses: supercharge/[email protected]
with:
redis-version: 6
- name: Start rrdcached
run: docker run -d -p 127.0.0.1:42217:42217 --name rrdcached -v /tmp/fireping/rrd:/data/db -e TZ="Europe/Paris" -e PUID=$(id -u $(whoami)) -e PGID=$(id -g $(whoami)) crazymax/rrdcached
- name: Install symfony
run: export PATH="$HOME/.symfony/bin:$PATH" ; if symfony self:version; then symfony self:update --yes ; else wget https://get.symfony.com/cli/installer -O - | bash ; fi
- uses: actions/checkout@v2
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress
- name: Dump Autoload (composer)
run: composer dump-autoload --optimize
- name: Create folders
run: mkdir build
- name: Run phpstan
run: composer phpstan
- name: Lint yaml
run: ./bin/console lint:yaml config --parse-tags
- name: Lint container
run: ./bin/console lint:container
- name: Set up Symfony path
run: export PATH="$HOME/.symfony5/bin:$PATH"
- name: Check Symfony Security
id: security_check
run: symfony check:security || echo "::warning::Security check failed"
- name: Continue execution
if: ${{ steps.security_check.outcome == 'success' }}
run: echo "Security check succeeded"
- name: Check doctrine mapping
run: ./bin/console doctrine:schema:validate --skip-sync -vvv --no-interaction
- name: Validate composer.json and composer.lock
run: composer validate
- name: Run phpunit
run: ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
- uses: actions/upload-artifact@v2
if: failure()
with:
name: artifact
path: ./var/log/test.log
- name: Upload coverage results to Coveralls
if: ${{ matrix.php-versions == '8.2' }}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/logs/clover.xml -v