Skip to content

Commit 89f0150

Browse files
Merge pull request #78 from neo4j-php/github-ci
Setup github workflow
2 parents 0d2d61a + 80290d1 commit 89f0150

File tree

5 files changed

+134
-1
lines changed

5 files changed

+134
-1
lines changed

.github/workflows/db-tests.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Tests with a database
2+
3+
on:
4+
push:
5+
branches: [ '**' ]
6+
pull_request:
7+
branches: ['**']
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
name: "Running Integration tests for PHP 7.1 on Neo4j ${{ matrix.neo4j-version }}"
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
neo4j-version: ["3.5", "4.2", "4.3", "4.4"]
17+
18+
services:
19+
neo4j:
20+
image: neo4j:${{ matrix.neo4j-version }}
21+
env:
22+
NEO4J_AUTH: neo4j/nothing
23+
ports:
24+
- 7687:7687
25+
- 7474:7474
26+
options: >-
27+
--health-cmd "wget http://localhost:7474 || exit 1"
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
- uses: php-actions/composer@v6
32+
with:
33+
progress: yes
34+
php_version: 7.1
35+
php_extensions: bcmath
36+
version: 2
37+
- uses: php-actions/phpunit@v3
38+
with:
39+
configuration: phpunit.xml.dist
40+
php_version: 7.1
41+
version: 7.5
42+
php_extensions: bcmath
43+
args: --testsuite "Database"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Tests without a database
2+
3+
on:
4+
push:
5+
branches: [ '**' ]
6+
pull_request:
7+
branches: ['**']
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
name: "Running Tests for PHP ${{ matrix.php-version }}"
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php-version: ['7.1', '7.2', '7.3', '7.4']
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- uses: php-actions/composer@v6
21+
with:
22+
progress: yes
23+
php_version: ${{ matrix.php-version }}
24+
php_extensions: bcmath
25+
version: 2
26+
- uses: php-actions/phpunit@v3
27+
with:
28+
configuration: phpunit.xml.dist
29+
version: 7.5
30+
php_version: ${{ matrix.php-version }}
31+
php_extensions: bcmath
32+
args: --testsuite "NoDatabase"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Tests without a database
2+
3+
on:
4+
push:
5+
branches: [ '**' ]
6+
pull_request:
7+
branches: ['**']
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
name: "Running Tests for PHP ${{ matrix.php-version }}"
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php-version: ['8.0', '8.1']
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- uses: php-actions/composer@v6
21+
with:
22+
progress: yes
23+
php_version: ${{ matrix.php-version }}
24+
php_extensions: bcmath
25+
version: 2
26+
- uses: php-actions/phpunit@v3
27+
with:
28+
configuration: phpunit.xml.dist
29+
php_version: ${{ matrix.php-version }}
30+
php_extensions: bcmath
31+
args: --testsuite "NoDatabase"

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
<file>src/Bolt.php</file>
1919
</whitelist>
2020
</filter>
21-
</phpunit>
21+
</phpunit>

phpunit.xml.dist

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<phpunit colors="true" verbose="true"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
convertNoticesToExceptions="true"
5+
convertWarningsToExceptions="true"
6+
convertErrorsToExceptions="true"
7+
convertDeprecationsToExceptions="true"
8+
bootstrap="src/autoload.php"
9+
>
10+
<testsuites>
11+
<testsuite name="Database">
12+
<directory>./tests/connection</directory>
13+
<file>./tests/BoltTest.php</file>
14+
</testsuite>
15+
<testsuite name="NoDatabase">
16+
<directory>./tests/error</directory>
17+
<directory>./tests/PackStream</directory>
18+
<directory>./tests/protocol</directory>
19+
</testsuite>
20+
</testsuites>
21+
<php>
22+
<var name="NEO_USER" value="neo4j"/>
23+
<var name="NEO_PASS" value="nothing"/>
24+
</php>
25+
</phpunit>
26+
27+

0 commit comments

Comments
 (0)