Skip to content

Commit 6f2bb6b

Browse files
committed
Merge branch 'utnaf-issue_39'
2 parents 102b69f + 5e44d84 commit 6f2bb6b

23 files changed

+1986
-6277
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ indent_size = 4
77
indent_style = space
88
insert_final_newline = true
99
trim_trailing_whitespace = true
10+
11+
[*.yml]
12+
indent_size = 2
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
on: [ pull_request ]
2+
name: Lint
3+
jobs:
4+
php-cs-fixer:
5+
name: "Lint"
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: "PHP-CS-Fixer"
10+
uses: docker://oskarstark/php-cs-fixer-ga:2.19.0
11+
with:
12+
args: --dry-run
13+
- name: "PSalm"
14+
uses: docker://vimeo/psalm-github-actions
15+
with:
16+
composer_require_dev: true
17+
composer_ignore_platform_reqs: false

.github/workflows/tests.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: Unit and Integration Tests
2+
3+
on:
4+
pull_request:
5+
branches: [ '**' ]
6+
7+
jobs:
8+
tests:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
php-version: ['7.4', '8']
14+
neo4j-version: ["3.5", "4.0", "4.1", "4.2"]
15+
name: "Running Tests for PHP ${{ matrix.php-version }} on Neo4j ${{ matrix.neo4j-version }}"
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@v2
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+
&& docker-php-ext-install -j$(nproc) gd sockets bcmath \
112+
&& pecl install ds \
113+
&& docker-php-ext-enable ds
114+
- name: Install Composer
115+
run: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
116+
- name: Install dependencies
117+
run: /usr/local/bin/composer install
118+
- name: Run Unit tests
119+
run: vendor/bin/phpunit tests/Unit
120+
- name: Run Integration tests
121+
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+

Dockerfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,9 @@ WORKDIR /opt/project
2929
COPY composer.json composer.lock phpunit.xml.dist phpunit.coverage.xml.dist psalm.xml .php_cs ./
3030
COPY src/ src/
3131
COPY tests/ tests/
32-
COPY tools/ tools/
3332
COPY .git/ .git/
3433

3534

36-
RUN composer install && \
37-
composer install --working-dir=tools/php-cs-fixer && \
38-
composer install --working-dir=tools/psalm
39-
35+
RUN composer install
4036

4137

Jenkinsfile

Lines changed: 0 additions & 53 deletions
This file was deleted.

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"email": "[email protected]"
2020
}
2121
],
22+
"scripts": {
23+
"cs": " docker run --rm -it -w=/app -v ${PWD}:/app oskarstark/php-cs-fixer-ga:2.19.0"
24+
},
2225
"require": {
2326
"php": "^7.4 || ^8.0",
2427
"laudis/typed-enum": "^1.1",
@@ -41,7 +44,9 @@
4144
"phpunit/phpunit": "^9.0",
4245
"nyholm/psr7": "^1.3",
4346
"nyholm/psr7-server": "^1.0",
44-
"kriswallsmith/buzz": "^1.2"
47+
"kriswallsmith/buzz": "^1.2",
48+
"vimeo/psalm": "^4.7",
49+
"psalm/plugin-phpunit": "^0.15.1"
4550
},
4651
"autoload": {
4752
"psr-4": {

0 commit comments

Comments
 (0)