Skip to content

Commit 483d53e

Browse files
committed
more quality of life upgrades
2 parents b8875f1 + 94a342c commit 483d53e

12 files changed

+730
-435
lines changed

.github/workflows/psalm.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
name: Run Psalm
1010
runs-on: ubuntu-latest
1111

12+
1213
steps:
1314
- name: Checkout code
1415
uses: actions/checkout@v3

.github/workflows/test.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,22 @@ concurrency:
1010

1111
jobs:
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
@@ -35,7 +48,7 @@ jobs:
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

.github/workflows/testaura.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Use an official PHP image as the base image
2+
FROM php:8.1-cli
3+
4+
# Install necessary extensions (e.g., for Composer)
5+
RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libfreetype6-dev git libzip-dev zip \
6+
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
7+
&& docker-php-ext-install gd zip
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

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
"nyholm/psr7": "^1.8"
1111
},
1212
"require-dev": {
13-
"phpunit/phpunit": "^11.0",
13+
"phpunit/phpunit": "^10.0",
1414
"friendsofphp/php-cs-fixer": "^3.68",
15-
"vimeo/psalm": "^6.5",
16-
"dg/bypass-finals": "^1.9"
15+
"vimeo/psalm": "^6.8",
16+
"dg/bypass-finals": "^1.9",
17+
"psalm/plugin-phpunit": "^0.19.2"
1718

1819
},
1920
"autoload": {
@@ -49,7 +50,7 @@
4950
"scripts": {
5051
"cs": "vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes",
5152
"cs:fix": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
52-
"psalm": "vendor/bin/psalm"
53+
"psalm": "vendor/bin/psalm --no-cache --show-info=true"
5354
}
5455

5556
}

0 commit comments

Comments
 (0)