File tree Expand file tree Collapse file tree 6 files changed +126
-16
lines changed
Expand file tree Collapse file tree 6 files changed +126
-16
lines changed Original file line number Diff line number Diff line change 99 name : Run Psalm
1010 runs-on : ubuntu-latest
1111
12+
1213 steps :
1314 - name : Checkout code
1415 uses : actions/checkout@v3
Original file line number Diff line number Diff line change @@ -10,9 +10,22 @@ concurrency:
1010
1111jobs :
1212 tests :
13+ services :
14+ neo4j :
15+ image : neo4j:latest
16+ ports :
17+ - 7474:7474
18+ - 7687:7687
19+ env :
20+ NEO4J_AUTH : neo4j/password
21+ options : >-
22+ --health-cmd "wget --no-verbose --tries=1 --spider localhost:7474 || exit 1"
23+ --health-interval 10s
24+ --health-retries 5
25+ --health-timeout 5s
26+
1327 name : Run PHPUnit Tests
1428 runs-on : ubuntu-latest
15-
1629 steps :
1730 - name : Checkout code
1831 uses : actions/checkout@v3
3548
3649 - name : Run Tests without phpunit.xml
3750 env :
38- NEO4J_ADDRESS : ${{ secrets.NEO4J_ADDRESS }}
39- NEO4J_USERNAME : ${{ secrets.NEO4J_USERNAME }}
40- NEO4J_PASSWORD : ${{ secrets.NEO4J_PASSWORD }}
51+ NEO4J_ADDRESS : " http://localhost:7474 "
52+ NEO4J_USERNAME : " neo4j "
53+ NEO4J_PASSWORD : " password "
4154 run : vendor/bin/phpunit --configuration phpunit.dist.xml
Original file line number Diff line number Diff line change 1+ name : Test Neo4j Aura
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ workflow_dispatch : # Allows manual trigger
8+
9+ concurrency :
10+ group : neo4j-aura-test-main
11+ cancel-in-progress : true
12+
13+ jobs :
14+ tests-aura :
15+ name : Run PHPUnit Tests with Neo4j Aura
16+ runs-on : ubuntu-latest
17+
18+
19+ steps :
20+ - name : Checkout code
21+ uses : actions/checkout@v3
22+
23+ - name : Set up PHP
24+ uses : shivammathur/setup-php@v2
25+ with :
26+ php-version : 8.2
27+ tools : composer, xdebug
28+
29+ - name : Cache Composer dependencies
30+ uses : actions/cache@v3
31+ with :
32+ path : vendor
33+ key : ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
34+ restore-keys : ${{ runner.os }}-composer-
35+
36+ - name : Install dependencies
37+ run : composer install --no-progress --prefer-dist
38+
39+ - name : Run Tests
40+ env :
41+ NEO4J_ADDRESS : ${{ secrets.NEO4J_ADDRESS }}
42+ NEO4J_USERNAME : ${{ secrets.NEO4J_USERNAME }}
43+ NEO4J_PASSWORD : ${{ secrets.NEO4J_PASSWORD }}
44+ run : vendor/bin/phpunit --configuration phpunit.dist.xml
Original file line number Diff line number Diff line change 1+ # Use an official PHP image as the base image
2+ FROM php:8.2-fpm
3+
4+ # Install necessary extensions (e.g., for Composer)
5+ RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libfreetype6-dev \
6+ && docker-php-ext-configure gd --with-freetype --with-jpeg \
7+ && docker-php-ext-install gd
8+
9+ # Set working directory
10+ WORKDIR /var/www
11+
12+ # Copy the composer.phar file to the container
13+ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
14+
15+ # Expose PHP-FPM port
16+ EXPOSE 9000
17+
18+ # Start PHP-FPM server
19+ CMD ["php-fpm" ]
Original file line number Diff line number Diff line change 1+ version : ' 3.8'
2+
3+ services :
4+ # PHP Service
5+ app :
6+ build :
7+ context : .
8+ dockerfile : Dockerfile
9+ container_name : php-app
10+ working_dir : /var/www
11+ volumes :
12+ - .:/var/www
13+ networks :
14+ - mynetwork
15+ ports :
16+ - " 9000:9000" # Exposing port for PHP-FPM
17+
18+ # Composer Service
19+ composer :
20+ image : composer:latest
21+ container_name : composer
22+ volumes :
23+ - .:/var/www
24+ working_dir : /var/www
25+ networks :
26+ - mynetwork
27+ command : ["install", "--no-progress", "--prefer-dist"]
28+
29+ # Neo4j Service (Optional, if you need Neo4j)
30+ neo4j :
31+ image : neo4j:latest
32+ container_name : neo4j
33+ environment :
34+ - NEO4J_AUTH=neo4j/password
35+ ports :
36+ - " 7474:7474" # Web interface
37+ - " 7687:7687" # Bolt protocol
38+ networks :
39+ - mynetwork
40+
41+ # Define a network for communication between containers
42+ networks :
43+ mynetwork :
44+ driver : bridge
Original file line number Diff line number Diff line change @@ -393,18 +393,7 @@ public function testInvalidQueryException(): void
393393 }
394394 }
395395
396- public function testCreateDuplicateConstraintException (): void
397- {
398- try {
399- $ this ->api ->run ('CREATE CONSTRAINT person_name FOR (n:Person1) REQUIRE n.name IS UNIQUE ' , []);
400- $ this ->fail ('Expected a Neo4jException to be thrown. ' );
401- } catch (Neo4jException $ e ) {
402- // $errorMessages = $e->getErrorType() . $e->errorSubType() . $e->errorName();
403- $ this ->assertInstanceOf (Neo4jException::class, $ e );
404- $ this ->assertEquals ('Neo.ClientError.Schema.EquivalentSchemaRuleAlreadyExists ' , $ e ->getErrorCode ());
405- $ this ->assertNotEmpty ($ e ->getMessage ());
406- }
407- }
396+
408397
409398 public function testWithExactNames (): void
410399 {
You can’t perform that action at this time.
0 commit comments