-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (110 loc) · 4.47 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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: CI
env:
APPLICATION_ENV: 'development'
APPLICATION_STORE: 'DE'
PROJECT: 'Unzer'
DATABASE_VERSION: 10.2
DATABASE_HOST: 127.0.0.1
DATABASE_PORT: 3306
DATABASE_NAME: eu-docker
DATABASE_USERNAME: root
DATABASE_PASSWORD: secret
DATABASE_ROOT_PASSWORD: secret
DATABASE_ALLOW_EMPTY_PASSWORD: false
DATABASE_CHARACTER_SET: utf8
DATABASE_COLLATE: utf8_general_ci
on:
pull_request:
push:
branches:
- 'master'
workflow_dispatch:
jobs:
setup:
name: Setup Database MariaDB
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: getong/mariadb-action@v1.1
with:
host port: ${{ env.DATABASE_PORT }}
container port: ${{ env.DATABASE_PORT }}
character set server: ${{ env.DATABASE_CHARACTER_SET }}
collation server: ${{ env.DATABASE_COLLATE }}
mariadb version: ${{ env.DATABASE_VERSION }}
mysql database: ${{ env.DATABASE_NAME }}
mysql root password: ${{ env.DATABASE_ROOT_PASSWORD }}
mysql user: ${{ env.DATABASE_USERNAME }}
mysql password: ${{ env.DATABASE_PASSWORD }}
ci:
name: Unzer (PHP ${{ matrix.php-versions }})
needs: setup
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php-versions:
- '8.1'
- '8.2'
services:
mariadb:
image: mariadb:10.2
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: eu-docker
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout@v2
uses: actions/checkout@v2
- name: Setup PHP ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, bcmath, pdo_mysql
- name: Get composer cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php-versions }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.php-versions }}-composer-
- name: Composer validate
run: composer validate
- name: Composer version
run: composer --version
- name: Composer install
run: composer install --prefer-dist --no-interaction --optimize-autoloader
- name: PHP syntax validation
run: find ./src -path src -prune -o -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )
- name: Check codestyle checks
run: composer cs-check
- name: Run codeception tests
run: composer test
- name: Run PHPStan checks
run: composer stan
lowest:
name: Unzer Prefer Lowest (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, intl, bcmath, pdo_mysql
- name: Composer Install
run: composer install --prefer-dist --no-interaction --profile
- name: Composer Update
run: composer update --prefer-lowest --prefer-dist --no-interaction --profile -vvv
- name: Prefer lowest installation
run: composer require --dev dereuromark/composer-prefer-lowest;
- name: PHP syntax validation
run: find ./src -path src -prune -o -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )
- name: Prefer lowest validation
run: vendor/bin/validate-prefer-lowest -m