Skip to content

Commit 9739c9b

Browse files
Conflicts: .travis.yml composer.json
2 parents 9a1a3c0 + c8bd877 commit 9739c9b

File tree

3 files changed

+125
-4
lines changed

3 files changed

+125
-4
lines changed

.coveralls.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
coverage_clover: coveralls.clover
2-
service_name: travis-ci
1+
coverage_clover: coverage.clover
32
json_path: ./coveralls.json
3+
repo_token: PpZCCrM6aBtU9l5xdzeOFj8bakIcaJqgD
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Test application
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- '[0-9]+.[0-9]+'
8+
- '[0-9]+.x'
9+
10+
jobs:
11+
php:
12+
name: 'Run tests with php ${{ matrix.php-version }}'
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- php-version: '5.6'
20+
lint: false
21+
symfony-version: '^2.8'
22+
elasticsearch-package-constraint: '^5.0'
23+
env:
24+
ELASTICSEARCH_HOST: '127.0.0.1:9205'
25+
26+
- php-version: '7.0'
27+
lint: false
28+
symfony-version: '^3.4'
29+
elasticsearch-package-constraint: '^5.0'
30+
env:
31+
ELASTICSEARCH_HOST: '127.0.0.1:9205'
32+
33+
- php-version: '7.2'
34+
lint: false
35+
symfony-version: '^3.4'
36+
elasticsearch-package-constraint: '^5.0'
37+
env:
38+
ELASTICSEARCH_HOST: '127.0.0.1:9205'
39+
40+
- php-version: '7.3'
41+
lint: false
42+
symfony-version: '^4.4'
43+
elasticsearch-package-constraint: '^5.0'
44+
env:
45+
ELASTICSEARCH_HOST: '127.0.0.1:9205'
46+
47+
- php-version: '7.4'
48+
lint: true
49+
symfony-version: '^5.0'
50+
elasticsearch-package-constraint: '^5.0'
51+
env:
52+
ELASTICSEARCH_HOST: '127.0.0.1:9205'
53+
54+
services:
55+
elasticsearch5:
56+
image: elasticsearch:5.6.14
57+
ports:
58+
- 9205:9200
59+
env:
60+
discovery.type: 'single-node'
61+
xpack.security.enabled: 'false'
62+
options: --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=5
63+
64+
elasticsearch6:
65+
image: elasticsearch:6.8.4
66+
ports:
67+
- 9206:9200
68+
env:
69+
discovery.type: 'single-node'
70+
xpack.security.enabled: 'false'
71+
options: --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=5
72+
73+
elasticsearch7:
74+
image: elasticsearch:7.9.3
75+
ports:
76+
- 9202:9200
77+
env:
78+
discovery.type: 'single-node'
79+
xpack.security.enabled: 'false'
80+
options: --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=5
81+
82+
steps:
83+
- name: Checkout project
84+
uses: actions/checkout@v2
85+
86+
- name: Install and configure PHP
87+
uses: shivammathur/setup-php@v2
88+
with:
89+
php-version: ${{ matrix.php-version }}
90+
tools: 'composer'
91+
92+
- name: Get composer cache directory
93+
id: composer-cache-dir
94+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
95+
96+
- name: Cache dependencies
97+
uses: actions/cache@v2
98+
id: composer-cache
99+
with:
100+
path: ${{ steps.composer-cache-dir.outputs.dir }}
101+
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json', 'composer.lock') }}
102+
restore-keys: |
103+
${{ runner.os }}-composer-
104+
105+
- name: Install dependencies
106+
run: |
107+
composer validate
108+
composer require --no-update symfony/symfony:${{ matrix.symfony-version }}
109+
composer require --no-update elasticsearch/elasticsearch:${{ matrix.elasticsearch-package-constraint }}
110+
composer install --no-interaction --prefer-dist
111+
112+
- name: Fix code style
113+
if: ${{ matrix.lint }}
114+
run: vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor/,Tests/app/ ./
115+
116+
- name: Run tests
117+
run: vendor/bin/simple-phpunit --coverage-clover=coverage.clover
118+
119+
- name: Upload coverage results to Coveralls
120+
run: vendor/bin/php-coveralls -v
121+
env:
122+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"require-dev": {
3232
"mikey179/vfsstream": "~1.4",
3333
"squizlabs/php_codesniffer": "~2.0",
34-
"satooshi/php-coveralls": "~1.0 || ~2.0",
3534
"symfony/browser-kit" : "^2.8|^3.4|^4|^5",
3635
"symfony/expression-language" : "^2.8|^3.4|^4|^5",
3736
"symfony/twig-bundle": "^2.8|^3.4|^4|^5",
@@ -41,7 +40,7 @@
4140
"symfony/dependency-injection": "^2.8|^3.4|^4|^5",
4241
"symfony/validator": "^2.8|^3.4|^4|^5",
4342
"symfony/options-resolver": "^2.8|^3.4|^4|^5",
44-
"symfony/var-dumper": "^2.8|^3.4|^4|^5"
43+
"php-coveralls/php-coveralls": "^2.4.3"
4544
},
4645
"autoload": {
4746
"psr-4": { "ONGR\\ElasticsearchBundle\\": "" },

0 commit comments

Comments
 (0)