forked from pmishev/ElasticsearchBundle
-
Notifications
You must be signed in to change notification settings - Fork 3
124 lines (108 loc) · 4.93 KB
/
phpunit-tests.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
name: tests
concurrency:
group: phpunit-tests-${{ github.ref_name }}
cancel-in-progress: true
on: ['push', 'pull_request', 'workflow_dispatch']
env:
ELASTICSEARCH_PORT: 9201
jobs:
static_code_analysis:
runs-on: 'ubuntu-20.04'
name: 'Static code analysis'
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- name: Checkout
uses: actions/checkout@v4
- name: 'Validate composer.json and composer.lock'
run: composer validate
- name: 'Install dependencies with Composer'
uses: 'ramsey/composer-install@v2'
with:
dependency-versions: 'highest'
composer-options: '--prefer-dist'
- name: Check PHP coding standards
run: php vendor/bin/php-cs-fixer fix --verbose --dry-run
phpunit:
needs: [ static_code_analysis ]
runs-on: 'ubuntu-20.04'
name: 'PHPUnit (PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, ES ${{ matrix.elasticsearch }})'
timeout-minutes: 30
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
experimental:
- false
dependencies:
- 'highest'
php:
- '8.1'
- '8.3'
elasticsearch:
- '7.17.24'
symfony:
- '~6.0'
include:
- php: '8.3'
symfony: '~6.0'
elasticsearch: '8.0.1'
experimental: false
- php: '8.3'
symfony: '~6.0'
elasticsearch: '8.1.3' # there are some bc in minor version https://www.elastic.co/guide/en/elasticsearch/reference/current/migrating-8.1.html#breaking-changes-8.1
experimental: false
- php: '8.3'
symfony: '~6.0'
elasticsearch: '8.5.3' # there are some bc in minor version https://www.elastic.co/guide/en/elasticsearch/reference/current/migrating-8.5.html
experimental: false
- php: '8.3'
symfony: '~6.0'
elasticsearch: '8.6.2' # there are no bc in minor version https://www.elastic.co/guide/en/elasticsearch/reference/current/migrating-8.6.html
experimental: false
- php: '8.3'
symfony: '~6.0'
elasticsearch: '8.7.1' # there are no bc in minor version https://www.elastic.co/guide/en/elasticsearch/reference/current/migrating-8.7.html
experimental: false
- php: '8.3'
symfony: '~6.0'
elasticsearch: '8.8.0' # there are no bc in minor version https://www.elastic.co/guide/en/elasticsearch/reference/current/migrating-8.8.html
experimental: false
- php: '8.1'
symfony: '~5.0'
elasticsearch: '8.15.2' # newest version
experimental: false
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '${{ matrix.php }}'
coverage: 'pcov'
tools: 'composer:v2'
extensions: 'curl, json, mbstring, openssl'
ini-values: 'memory_limit=256M'
- name: 'Fix symfony/framework-bundle version'
run: composer require --no-update symfony/framework-bundle:${{ matrix.symfony }}
- name: 'Install dependencies with Composer'
uses: 'ramsey/composer-install@v2'
with:
dependency-versions: '${{ matrix.dependencies }}'
composer-options: '--prefer-dist'
- name: 'Dump composer autoloader'
run: composer dump-autoload --classmap-authoritative --no-ansi --no-interaction --no-scripts
- name: 'Setup Elasticsearch'
env:
ELASTICSEARCH_VERSION: ${{ matrix.elasticsearch }}
run: docker compose up --detach --wait ; curl -XGET 'http://localhost:'"$ELASTICSEARCH_PORT"
- name: 'Run phpunit tests'
run: |
vendor/bin/simple-phpunit --coverage-clover=tests/App/build/clover.xml
- name: Upload coverage results to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
vendor/bin/php-coveralls --coverage_clover=tests/App/build/clover.xml --json_path=tests/App/build/coveralls.json -v