Skip to content

Commit ffad7fe

Browse files
authored
Merge pull request #53 from neo4j-php/v2.0
V2.0
2 parents 59c8ad9 + ddbd1ee commit ffad7fe

File tree

110 files changed

+7548
-7014
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+7548
-7014
lines changed

.github/workflows/coverage.yml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: Unit and Integration Tests
2+
3+
on:
4+
push:
5+
branches: [ '**' ]
6+
7+
jobs:
8+
tests:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
php-version: ['8']
14+
neo4j-version: ["4.2"]
15+
name: "Create Test Coverage Report"
16+
17+
container:
18+
image: php:${{ matrix.php-version }}-cli
19+
20+
services:
21+
neo4j:
22+
image: neo4j:${{ matrix.neo4j-version }}
23+
ports:
24+
- 7474:7474
25+
- 7687:7687
26+
env:
27+
NEO4J_AUTH: neo4j/test
28+
29+
core1:
30+
image: neo4j:${{ matrix.neo4j-version }}-enterprise
31+
ports:
32+
- 7686:7686
33+
- 5000
34+
- 6000
35+
- 7000
36+
env:
37+
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
38+
NEO4J_AUTH: neo4j/test
39+
NEO4J_dbms_mode: CORE
40+
NEO4J_causalClustering_discoveryAdvertisedAddress: core1:5000
41+
NEO4J_causalClustering_transactionAdvertisedAddress: core1:6000
42+
NEO4J_causalClustering_raftAdvertisedAddress: core1:7000
43+
NEO4J_causalClustering_initialDiscoveryMembers: core1:5000,core2:5000,core3:5000
44+
NEO4J_causal__clustering_disable__middleware__logging: false
45+
NEO4J_dbms_connectors_default__advertised__address: core1
46+
47+
core2:
48+
image: neo4j:${{ matrix.neo4j-version }}-enterprise
49+
ports:
50+
- 7686
51+
- 5000
52+
- 6000
53+
- 7000
54+
env:
55+
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
56+
NEO4J_AUTH: neo4j/test
57+
NEO4J_dbms_mode: CORE
58+
NEO4J_causalClustering_discoveryAdvertisedAddress: core2:5000
59+
NEO4J_causalClustering_transactionAdvertisedAddress: core2:6000
60+
NEO4J_causalClustering_raftAdvertisedAddress: core2:7000
61+
NEO4J_causalClustering_initialDiscoveryMembers: core1:5000,core2:5000,core3:5000
62+
NEO4J_dbms_connectors_default__advertised__address: core2
63+
64+
core3:
65+
image: neo4j:${{ matrix.neo4j-version }}-enterprise
66+
ports:
67+
- 7686
68+
- 5000
69+
- 6000
70+
- 7000
71+
env:
72+
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
73+
NEO4J_AUTH: neo4j/test
74+
NEO4J_dbms_mode: CORE
75+
NEO4J_causalClustering_discoveryAdvertisedAddress: core3:5000
76+
NEO4J_causalClustering_transactionAdvertisedAddress: core3:6000
77+
NEO4J_causalClustering_raftAdvertisedAddress: core3:7000
78+
NEO4J_causalClustering_initialDiscoveryMembers: core1:5000,core2:5000,core3:5000
79+
NEO4J_dbms_connectors_default__advertised__address: core3
80+
81+
readreplica1:
82+
image: neo4j:${{ matrix.neo4j-version }}-enterprise
83+
ports:
84+
- 7686
85+
- 5000
86+
- 6000
87+
- 7000
88+
env:
89+
NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
90+
NEO4J_AUTH: neo4j/test
91+
NEO4J_dbms_mode: READ_REPLICA
92+
NEO4J_causalClustering_discoveryAdvertisedAddress: readreplica1:5000
93+
NEO4J_causalClustering_transactionAdvertisedAddress: readreplica1:6000
94+
NEO4J_causalClustering_raftAdvertisedAddress: readreplica1:7000
95+
NEO4J_causalClustering_initialDiscoveryMembers: core1:5000,core2:5000,core3:5000
96+
NEO4J_dbms_connectors_default__advertised__address: readreplica1
97+
98+
steps:
99+
- uses: actions/checkout@v1
100+
- name: Setup PHP
101+
run: |
102+
apt-get update && apt-get install -y \
103+
libfreetype6-dev \
104+
libjpeg62-turbo-dev \
105+
libmcrypt-dev \
106+
libpng-dev \
107+
libzip-dev \
108+
zip \
109+
unzip \
110+
wget \
111+
git \
112+
&& docker-php-ext-install -j$(nproc) gd sockets bcmath \
113+
&& pecl install ds xdebug \
114+
&& docker-php-ext-enable ds xdebug
115+
- name: Install Composer
116+
run: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
117+
- name: Install dependencies
118+
run: /usr/local/bin/composer install
119+
- name: Install Code Climate Test Reporter
120+
run: |
121+
wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 \
122+
&& mv test-reporter-latest-linux-amd64 /usr/bin/cc-test-reporter \
123+
&& chmod +x /usr/bin/cc-test-reporter
124+
- name: Run PHPUnit Coverage
125+
run: |
126+
cc-test-reporter before-build \
127+
&& XDEBUG_MODE=coverage vendor/bin/phpunit --config phpunit.coverage.xml.dist -d memory_limit=1024M \
128+
&& mkdir -p out/phpunit \
129+
&& cp out/phpunit/clover.xml clover.xml
130+
- name: Run Code Climate Test Reporter
131+
run: |
132+
cc-test-reporter after-build --id ec331dd009edca126a4c27f4921c129de840c8a117643348e3b75ec547661f28 --exit-code 0
133+

.github/workflows/tests.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Unit and Integration Tests
22

33
on:
4-
pull_request:
4+
push:
55
branches: [ '**' ]
66

77
jobs:
@@ -11,7 +11,7 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
php-version: ['7.4', '8']
14-
neo4j-version: ["3.5", "4.0", "4.1", "4.2"]
14+
neo4j-version: ["3.5", "4.0", "4.1", "4.2", "4.3"]
1515
name: "Running Tests for PHP ${{ matrix.php-version }} on Neo4j ${{ matrix.neo4j-version }}"
1616

1717
container:
@@ -109,8 +109,8 @@ jobs:
109109
unzip \
110110
wget \
111111
&& docker-php-ext-install -j$(nproc) gd sockets bcmath \
112-
&& pecl install ds \
113-
&& docker-php-ext-enable ds
112+
&& pecl install ds xdebug \
113+
&& docker-php-ext-enable ds xdebug
114114
- name: Install Composer
115115
run: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
116116
- name: Install dependencies
@@ -119,14 +119,3 @@ jobs:
119119
run: vendor/bin/phpunit tests/Unit
120120
- name: Run Integration tests
121121
run: vendor/bin/phpunit tests/Integration
122-
- name: Coverage
123-
run: |
124-
wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 \
125-
&& mv test-reporter-latest-linux-amd64 /usr/bin/cc-test-reporter \
126-
&& chmod +x /usr/bin/cc-test-reporter \
127-
&& cc-test-reporter before-build \
128-
&& vendor/bin/phpunit --config phpunit.coverage.xml.dist -d memory_limit=1024M \
129-
&& mkdir -p out/phpunit \
130-
&& cp out/phpunit/clover.xml clover.xml \
131-
&& cc-test-reporter after-build --id ec331dd009edca126a4c27f4921c129de840c8a117643348e3b75ec547661f28 --exit-code 0
132-

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ phpunit.xml
66
.idea/
77
clover.xml
88
cc-test-reporter
9+
/run-pipeline.sh
10+
composer.lock

.php_cs renamed to .php-cs-fixer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* file that was distributed with this source code.
1212
*/
1313

14+
use PhpCsFixer\Config;
15+
1416
$header = <<<'EOF'
1517
This file is part of the Laudis Neo4j package.
1618
@@ -30,7 +32,7 @@
3032
exit(1);
3133
}
3234

33-
return PhpCsFixer\Config::create()
35+
return (new Config())
3436
->setRules([
3537
'@Symfony' => true,
3638

Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:7.4-cli
1+
FROM php:8.0-cli
22
RUN apt-get update && apt-get install -y \
33
libfreetype6-dev \
44
libjpeg62-turbo-dev \
@@ -16,17 +16,14 @@ RUN apt-get update && apt-get install -y \
1616
&& mv test-reporter-latest-linux-amd64 /usr/bin/cc-test-reporter \
1717
&& chmod +x /usr/bin/cc-test-reporter
1818

19-
ARG WITH_XDEBUG=false
19+
RUN pecl install xdebug \
20+
&& docker-php-ext-enable xdebug
2021

21-
RUN if [ $WITH_XDEBUG = "true" ] ; then \
22-
pecl install channel://pecl.php.net/xdebug-2.9.3; \
23-
docker-php-ext-enable xdebug; \
24-
fi;
2522
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
2623

2724
WORKDIR /opt/project
2825

29-
COPY composer.json composer.lock phpunit.xml.dist phpunit.coverage.xml.dist psalm.xml .php_cs ./
26+
COPY composer.json composer.lock phpunit.xml.dist phpunit.coverage.xml.dist psalm.xml .php-cs-fixer.php ./
3027
COPY src/ src/
3128
COPY tests/ tests/
3229
COPY .git/ .git/

0 commit comments

Comments
 (0)