Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 54 additions & 39 deletions .github/workflows/integration-test-aura.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,54 @@
#name: Integration Tests
#
#on:
# push:
# branches:
# - main
# pull_request:
# branches:
# - main
#
#jobs:
# tests:
# runs-on: ubuntu-latest
# env:
# CONNECTION: ${{ secrets.AURA_PRO }}
# name: "Running on all provided Aura instances"
#
# steps:
# - uses: actions/checkout@v2
# - name: Cache Composer dependencies
# uses: actions/cache@v2
# with:
# path: /tmp/composer-cache
# key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
# - uses: php-actions/composer@v6
# with:
# progress: yes
# php_version: 8.1
# version: 2
# - name: clean database
# run: CONNECTION=$CONNECTION php tests/clean-database.php
# - uses: php-actions/phpunit@v3
# with:
# configuration: phpunit.xml.dist
# php_version: 8.1
# memory_limit: 1024M
# version: 10
# testsuite: Integration
# bootstrap: vendor/autoload.php
name: Integration Tests

on:
push:
branches:
- main
pull_request:

concurrency:
group: integration-tests-aura
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
name: "Running on all provided Aura instances"
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build & cache client image
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
load: true
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: PHP_VERSION=8.1.31
tags: integration-client:8.1.31

- name: Populate .env
run: |
echo "PHP_VERSION=8.1.31" > .env
echo "CONNECTION=\"${{ secrets.AURA_PRO }}\"" >> .env

- name: Cache PHP deps
id: cache-php-deps
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-8.1.31-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-8.1.31-

- name: Install PHP deps
if: steps.cache-php-deps.outputs.cache-hit != 'true'
run: docker compose run --rm client composer install

- name: Run tests
run: docker compose run --rm client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
70 changes: 59 additions & 11 deletions .github/workflows/integration-test-cluster-neo4j-4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,77 @@ on:
branches:
- main
pull_request:
branches:
- main

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.1.31', '8.3.17']
php: ["8.1.31", "8.3.17"]
name: "Running on PHP ${{ matrix.php }} in a Neo4j 4.4 cluster"

steps:
- uses: actions/checkout@v4

- name: Restore Neo4j Image Cache if it exists
id: cache-docker-neo4j
uses: actions/cache@v4
with:
path: ci/cache/docker/neo4j
key: cache-docker-neo4j-4-enterprise

- name: Update Neo4j Image Cache if cache miss
if: steps.cache-docker-neo4j.outputs.cache-hit != 'true'
run: |
docker pull neo4j:4.4-enterprise
mkdir -p ci/cache/docker/neo4j
docker image save neo4j:4.4-enterprise --output ./ci/cache/docker/neo4j/neo4j-4-enterprise.tar

- name: Use Neo4j Image Cache if cache hit
if: steps.cache-docker-neo4j.outputs.cache-hit == 'true'
run: docker image load --input ./ci/cache/docker/neo4j/neo4j-4-enterprise.tar

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build & cache client image
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
load: true
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: PHP_VERSION=${{ matrix.php }}
tags: integration-client:${{ matrix.php }}

- name: Populate .env
run: |
echo "PHP_VERSION=${{ matrix.php }}" > .env
echo "CONNECTION=neo4j://neo4j:testtest@core1" >> .env
- uses: hoverkraft-tech/[email protected]
name: Start services
echo "CONNECTION=neo4j://neo4j:testtest@server1" >> .env

- name: Cache PHP deps
id: cache-php-deps
uses: actions/cache@v4
with:
compose-file: './docker-compose-neo4j-4.yml'
up-flags: '--build --remove-orphans'
- name: Test
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-

- name: Install PHP deps
if: steps.cache-php-deps.outputs.cache-hit != 'true'
run: |
docker compose -f docker-compose-neo4j-4.yml run --rm client composer install

- name: Run integration tests
run: |
docker compose run client composer install
docker compose run client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
docker compose -f docker-compose-neo4j-4.yml up -d --no-build --remove-orphans --wait \
server1 \
server2 \
server3 \
server4

docker compose -f docker-compose-neo4j-4.yml run --rm client \
./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
69 changes: 59 additions & 10 deletions .github/workflows/integration-test-cluster-neo4j-5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,78 @@ on:
branches:
- main
pull_request:
branches:
- main

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.1.31', '8.3.17']
php: ["8.1.31", "8.3.17"]
name: "Running on PHP ${{ matrix.php }} with a Neo4j 5.20-enterprise cluster"

steps:
- uses: actions/checkout@v4

- name: Restore Neo4j Image Cache if it exists
id: cache-docker-neo4j
uses: actions/cache@v4
with:
path: ci/cache/docker/neo4j
key: cache-docker-neo4j-5-enterprise

- name: Update Neo4j Image Cache if cache miss
if: steps.cache-docker-neo4j.outputs.cache-hit != 'true'
run: |
docker pull neo4j:5-enterprise
mkdir -p ci/cache/docker/neo4j
docker image save neo4j:5-enterprise --output ./ci/cache/docker/neo4j/neo4j-5-enterprise.tar

- name: Use Neo4j Image Cache if cache hit
if: steps.cache-docker-neo4j.outputs.cache-hit == 'true'
run: docker image load --input ./ci/cache/docker/neo4j/neo4j-5-enterprise.tar

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build & cache client image
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
load: true
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: PHP_VERSION=${{ matrix.php }}
tags: integration-client:${{ matrix.php }}

- name: Populate .env
run: |
echo "PHP_VERSION=${{ matrix.php }}" > .env
echo "CONNECTION=neo4j://neo4j:testtest@server1" >> .env
- uses: hoverkraft-tech/[email protected]
name: Start services

- name: Cache PHP deps
id: cache-php-deps
uses: actions/cache@v4
with:
compose-file: './docker-compose.yml'
up-flags: '--build --remove-orphans'
- name: Test
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-

- name: Install PHP deps
if: steps.cache-php-deps.outputs.cache-hit != 'true'
run: |
docker compose run --rm client composer install

- name: Run integration tests
run: |
docker compose run client composer install
docker compose run client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
docker compose up -d --remove-orphans --wait --no-build \
server1 \
server2 \
server3 \
server4

# install PHP deps and run PHPUnit inside the client container
docker compose run --rm client \
./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
Loading