Skip to content

Commit 8806403

Browse files
committed
Used php-actions
1 parent e59f531 commit 8806403

File tree

5 files changed

+50
-102
lines changed

5 files changed

+50
-102
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Unit and Integration Tests
1+
name: Full Test
22

33
on:
44
push:
@@ -10,20 +10,30 @@ jobs:
1010
tests:
1111
runs-on: ubuntu-latest
1212
name: "Create Test Coverage Report"
13+
env:
14+
NEO4J_CONNECTIONS: ${{ secrets.NEO4J_CONNECTIONS }}
1315

14-
container:
15-
image: php:8.0-cli
16-
env:
17-
NEO4J_CONNECTIONS: ${{ secrets.NEO4J_CONNECTIONS }}
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: php-actions/composer@v6
19+
with:
20+
progress: yes
21+
php_version: 7.4
22+
version: 2
23+
- uses: php-actions/phpunit@v3
24+
with:
25+
configuration: phpunit.xml.dist
26+
php_version: 7.4
27+
php_extensions: bcmath
28+
memory_limit: 1024M
29+
bootstrap: vendor/autoload.php
1830

1931
services:
2032
neo4j:
2133
image: neo4j:4.3
22-
ports:
23-
- 7474:7474
24-
- 7687:7687
2534
env:
2635
NEO4J_AUTH: neo4j/test
36+
NEO4JLABS_PLUGINS: '["apoc"]'
2737
options: >-
2838
--health-cmd "wget http://localhost:7474 || exit 1"
2939
--health-interval 30s
@@ -32,13 +42,9 @@ jobs:
3242
3343
core1:
3444
image: neo4j:4.3-enterprise
35-
ports:
36-
- 7686:7686
37-
- 5000
38-
- 6000
39-
- 7000
4045
env:
4146
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
47+
NEO4JLABS_PLUGINS: '["apoc"]'
4248
NEO4J_AUTH: neo4j/test
4349
NEO4J_dbms_mode: CORE
4450
NEO4J_causalClustering_discoveryAdvertisedAddress: core1:5000
@@ -49,18 +55,11 @@ jobs:
4955
NEO4J_dbms_connectors_default__advertised__address: core1
5056
options: >-
5157
--health-cmd "wget http://localhost:7474 || exit 1"
52-
--health-interval 30s
53-
--health-timeout 10s
54-
--health-retries 5
5558
core2:
5659
image: neo4j:4.3-enterprise
57-
ports:
58-
- 7686
59-
- 5000
60-
- 6000
61-
- 7000
6260
env:
6361
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
62+
NEO4JLABS_PLUGINS: '["apoc"]'
6463
NEO4J_AUTH: neo4j/test
6564
NEO4J_dbms_mode: CORE
6665
NEO4J_causalClustering_discoveryAdvertisedAddress: core2:5000
@@ -71,13 +70,9 @@ jobs:
7170

7271
core3:
7372
image: neo4j:4.3-enterprise
74-
ports:
75-
- 7686
76-
- 5000
77-
- 6000
78-
- 7000
7973
env:
8074
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
75+
NEO4JLABS_PLUGINS: '["apoc"]'
8176
NEO4J_AUTH: neo4j/test
8277
NEO4J_dbms_mode: CORE
8378
NEO4J_causalClustering_discoveryAdvertisedAddress: core3:5000
@@ -87,19 +82,12 @@ jobs:
8782
NEO4J_dbms_connectors_default__advertised__address: core3
8883
options: >-
8984
--health-cmd "wget http://localhost:7474 || exit 1"
90-
--health-interval 30s
91-
--health-timeout 10s
92-
--health-retries 5
9385
9486
readreplica1:
9587
image: neo4j:4.3-enterprise
96-
ports:
97-
- 7686
98-
- 5000
99-
- 6000
100-
- 7000
10188
env:
10289
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
90+
NEO4JLABS_PLUGINS: '["apoc"]'
10391
NEO4J_AUTH: neo4j/test
10492
NEO4J_dbms_mode: READ_REPLICA
10593
NEO4J_causalClustering_discoveryAdvertisedAddress: readreplica1:5000
@@ -109,37 +97,4 @@ jobs:
10997
NEO4J_dbms_connectors_default__advertised__address: readreplica1
11098
options: >-
11199
--health-cmd "wget http://localhost:7474 || exit 1"
112-
--health-interval 30s
113-
--health-timeout 10s
114-
--health-retries 5
115100
116-
steps:
117-
- uses: actions/checkout@v1
118-
- name: Setup PHP
119-
run: |
120-
apt-get update && apt-get install -y \
121-
libzip-dev \
122-
unzip \
123-
wget \
124-
git \
125-
&& docker-php-ext-install -j$(nproc) bcmath \
126-
&& pecl install xdebug \
127-
&& docker-php-ext-enable xdebug
128-
- name: Install Composer
129-
run: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
130-
- name: Install dependencies
131-
run: /usr/local/bin/composer install
132-
- name: Install Code Climate Test Reporter
133-
run: |
134-
wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 \
135-
&& mv test-reporter-latest-linux-amd64 /usr/bin/cc-test-reporter \
136-
&& chmod +x /usr/bin/cc-test-reporter
137-
- name: Run PHPUnit Coverage
138-
run: |
139-
cc-test-reporter before-build \
140-
&& XDEBUG_MODE=coverage vendor/bin/phpunit --config phpunit.coverage.xml.dist -d memory_limit=1024M \
141-
&& mkdir -p out/phpunit \
142-
&& cp out/phpunit/clover.xml clover.xml
143-
- name: Run Code Climate Test Reporter
144-
run: |
145-
cc-test-reporter after-build --id ec331dd009edca126a4c27f4921c129de840c8a117643348e3b75ec547661f28 --exit-code 0

.github/workflows/matrix-test.yml

+16-25
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,35 @@ on:
99
jobs:
1010
tests:
1111
runs-on: ubuntu-latest
12+
env:
13+
NEO4J_CONNECTIONS: bolt://neo4j:test@neo4j,http://neo4j:test@neo4j
14+
name: "Running test for PHP ${{ matrix.php-version }} on Neo4j ${{ matrix.neo4j-version }} with simple config"
1215
strategy:
1316
fail-fast: false
1417
matrix:
1518
php-version: ['7.4', '8.0', '8.1']
1619
neo4j-version: ["3.5", "4.0", "4.1", "4.2", "4.3"]
17-
name: "Running test for PHP ${{ matrix.php-version }} on Neo4j ${{ matrix.neo4j-version }} with simple config"
18-
container:
19-
image: php:${{ matrix.php-version }}-cli
20-
env:
21-
NEO4J_CONNECTIONS: bolt://neo4j:test@neo4j,http://neo4j:test@neo4j
2220

2321
services:
2422
neo4j:
2523
image: neo4j:${{ matrix.neo4j-version }}
26-
ports:
27-
- 7474:7474
28-
- 7687:7687
2924
env:
3025
NEO4J_AUTH: neo4j/test
26+
NEO4JLABS_PLUGINS: '["apoc"]'
3127
options: >-
3228
--health-cmd "wget http://localhost:7474 || exit 1"
33-
--health-interval 30s
34-
--health-timeout 10s
35-
--health-retries 5
3629
3730
steps:
3831
- uses: actions/checkout@v2
39-
- name: Setup PHP
40-
run: |
41-
apt-get update && apt-get install -y \
42-
libzip-dev \
43-
unzip \
44-
&& docker-php-ext-install -j$(nproc) bcmath \
45-
- name: Install Composer
46-
run: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
47-
- name: Install dependencies
48-
run: /usr/local/bin/composer install
49-
- name: Run Unit tests
50-
run: vendor/bin/phpunit tests/Unit
51-
- name: Run Integration tests
52-
run: vendor/bin/phpunit tests/Integration
32+
- uses: php-actions/composer@v6
33+
with:
34+
progress: yes
35+
php_version: ${{ matrix.php-version }}
36+
version: 2
37+
- uses: php-actions/phpunit@v3
38+
with:
39+
configuration: phpunit.xml.dist
40+
php_version: ${{ matrix.php-version }}
41+
php_extensions: bcmath
42+
memory_limit: 1024M
43+
bootstrap: vendor/autoload.php

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.1-cli
1+
FROM php:7.4-cli
22
RUN apt-get update \
33
&& apt-get install -y \
44
libzip-dev \

docker-compose.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ services:
4949
neo4j:
5050
networks:
5151
- neo4j
52-
image: neo4j:4.3-enterprise
52+
image: neo4j:3.5-enterprise
5353
healthcheck:
5454
test: "wget http://localhost:7474 || exit 1"
5555
interval: 30s
@@ -66,7 +66,7 @@ services:
6666
volumes:
6767
- ./tests/resources:/import
6868
core1:
69-
image: neo4j:4.3-enterprise
69+
image: neo4j:3.5-enterprise
7070
healthcheck:
7171
test: "wget http://localhost:7474 || exit 1"
7272
interval: 30s
@@ -94,7 +94,7 @@ services:
9494
NEO4J_dbms_connector_bolt_advertised__address: core1:7687
9595

9696
core2:
97-
image: neo4j:4.3-enterprise
97+
image: neo4j:3.5-enterprise
9898
healthcheck:
9999
test: "wget http://localhost:7474 || exit 1"
100100
interval: 30s
@@ -119,7 +119,7 @@ services:
119119
- ./tests/resources:/import
120120

121121
core3:
122-
image: neo4j:4.3-enterprise
122+
image: neo4j:3.5-enterprise
123123
healthcheck:
124124
test: "wget http://localhost:7474 || exit 1"
125125
interval: 30s
@@ -144,7 +144,7 @@ services:
144144
- ./tests/resources:/import
145145

146146
readreplica1:
147-
image: neo4j:4.3-enterprise
147+
image: neo4j:3.5-enterprise
148148
healthcheck:
149149
test: "wget http://localhost:7474 || exit 1"
150150
interval: 30s

phpunit.coverage.xml.dist

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
<phpunit colors="true" verbose="true"
22
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
convertNoticesToExceptions="true"
5+
convertWarningsToExceptions="true"
6+
convertErrorsToExceptions="true"
7+
convertDeprecationsToExceptions="true"
48
>
59
<php>
6-
<ini name="memory_limit" value="512M" />
10+
<ini name="memory_limit" value="1024M" />
11+
712
</php>
813
<testsuites>
914
<testsuite name="Neo4j php test suite">
@@ -14,10 +19,7 @@
1419
<report>
1520
<clover outputFile="out/phpunit/clover.xml" />
1621
<html outputDirectory="out/phpunit/html" />
17-
<xml outputDirectory="out/phpunit/xml"/>
1822
<text outputFile="out/phpunit/out.txt"/>
19-
<php outputFile="out/phpunit/out.php"/>
20-
<crap4j outputFile="out/phpunit/crap4j.xml"/>
2123
</report>
2224
<include>
2325
<directory suffix=".php">src</directory>

0 commit comments

Comments
 (0)