-
Notifications
You must be signed in to change notification settings - Fork 795
146 lines (132 loc) · 4.33 KB
/
continuous-integration.yaml
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
137
138
139
140
141
142
143
144
145
146
name: 'Continuous integration'
on: ['push', 'pull_request']
jobs:
cs:
runs-on: 'ubuntu-latest'
name: 'Coding style'
steps:
- name: 'Checkout'
uses: 'actions/checkout@v2'
- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '8.1'
coverage: 'none'
extensions: 'json, mbstring, tokenizer'
tools: 'composer-normalize, php-cs-fixer:3.8.0'
- name: 'Display tools versions'
run: |
composer-normalize --version
php-cs-fixer --version
- name: 'Check PHP code'
run: 'php-cs-fixer fix --diff --dry-run --allow-risky=yes --using-cache=no'
- name: 'Check composer.json'
run: 'composer-normalize --diff --dry-run --no-update-lock'
if: 'always()'
phpunit:
runs-on: 'ubuntu-20.04'
name: 'PHPUnit (PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }} + ${{ matrix.dependencies }} deps, ES ${{ matrix.elasticsearch }})'
timeout-minutes: 10
env:
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
strategy:
matrix:
php:
- '7.4'
- '8.1'
- '8.2'
- '8.3'
symfony:
- '5.4.*'
- '6.4.*'
- '7.0.*'
elasticsearch:
- '7.11.0'
dependencies:
- 'highest'
exclude:
- php: '7.4'
symfony: '7.0.*'
- php: '7.4'
symfony: '6.4.*'
- php: '8.1'
symfony: '7.0.*'
fail-fast: false
steps:
- name: 'Checkout'
uses: 'actions/checkout@v2'
- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php }}'
coverage: 'none'
tools: 'pecl, composer:v2, flex'
extensions: 'curl, json, mbstring, mongodb, openssl'
- name: "Install Composer dependencies (${{ matrix.dependencies }})"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist --prefer-stable"
- name: 'Setup Elasticsearch'
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
docker network create elastic
docker run -d --name=elasticsearch --network=elastic -p 9200:9200 -e discovery.type=single-node -e node.name=es docker.elastic.co/elasticsearch/elasticsearch:${{ matrix.elasticsearch }} sh -c "./bin/elasticsearch-plugin install --batch ingest-attachment && /usr/local/bin/docker-entrypoint.sh"
docker run --rm --network=elastic curlimages/curl --max-time 120 --retry-max-time 120 --retry 120 --retry-delay 5 --retry-all-errors --show-error --silent http://elasticsearch:9200
- name: 'Run unit tests'
run: |
vendor/bin/phpunit
phpstan:
runs-on: 'ubuntu-latest'
name: 'PHPStan (PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }} + ${{ matrix.dependencies }} deps)'
timeout-minutes: 10
env:
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
strategy:
matrix:
php:
- '7.4'
- '8.1'
- '8.2'
- '8.3'
symfony:
- '5.4.*'
- '6.4.*'
- '7.0.*'
dependencies:
- 'highest'
include:
- php: '7.4'
dependencies: 'lowest'
symfony: '5.4.*'
exclude:
- php: '7.4'
symfony: '7.0.*'
- php: '7.4'
symfony: '6.4.*'
- php: '8.1'
symfony: '7.0.*'
- php: '8.1'
symfony: '4.4.*'
fail-fast: false
steps:
- name: 'Checkout'
uses: 'actions/checkout@v2'
- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php }}'
coverage: 'none'
tools: 'pecl, composer:v2, flex'
extensions: 'curl, json, mbstring, mongodb, openssl'
- name: "Install Composer dependencies (${{ matrix.dependencies }})"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist --prefer-stable"
- name: 'Run PHPStan'
run: |
composer sca