Skip to content

Commit 344f1a1

Browse files
committed
Merge remote-tracking branch 'origin/main' into test_summary
2 parents aa37a18 + c408ec2 commit 344f1a1

14 files changed

+459
-290
lines changed
Lines changed: 55 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,55 @@
1-
#name: Integration Tests
2-
#
3-
#on:
4-
# push:
5-
# branches:
6-
# - main
7-
# pull_request:
8-
# branches:
9-
# - main
10-
#
11-
#jobs:
12-
# tests:
13-
# runs-on: ubuntu-latest
14-
# env:
15-
# CONNECTION: ${{ secrets.AURA_PRO }}
16-
# name: "Running on all provided Aura instances"
17-
#
18-
# steps:
19-
# - uses: actions/checkout@v2
20-
# - name: Cache Composer dependencies
21-
# uses: actions/cache@v2
22-
# with:
23-
# path: /tmp/composer-cache
24-
# key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
25-
# - uses: php-actions/composer@v6
26-
# with:
27-
# progress: yes
28-
# php_version: 8.1
29-
# version: 2
30-
# - name: clean database
31-
# run: CONNECTION=$CONNECTION php tests/clean-database.php
32-
# - uses: php-actions/phpunit@v3
33-
# with:
34-
# configuration: phpunit.xml.dist
35-
# php_version: 8.1
36-
# memory_limit: 1024M
37-
# version: 10
38-
# testsuite: Integration
39-
# bootstrap: vendor/autoload.php
1+
name: Integration Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
concurrency:
10+
group: integration-tests-aura
11+
cancel-in-progress: true
12+
13+
jobs:
14+
tests:
15+
runs-on: ubuntu-latest
16+
name: "Running on all provided Aura instances"
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v2
22+
23+
- name: Build & cache client image
24+
uses: docker/build-push-action@v3
25+
with:
26+
context: .
27+
file: Dockerfile
28+
load: true
29+
push: false
30+
cache-from: type=gha
31+
cache-to: type=gha,mode=max
32+
build-args: PHP_VERSION=8.1.31
33+
tags: integration-client:8.1.31
34+
35+
- name: Populate .env
36+
run: |
37+
echo "PHP_VERSION=8.1.31" > .env
38+
echo "CONNECTION=\"${{ secrets.AURA_PRO }}\"" >> .env
39+
echo "CI=true" >> .env
40+
41+
- name: Cache PHP deps
42+
id: cache-php-deps
43+
uses: actions/cache@v4
44+
with:
45+
path: vendor
46+
key: ${{ runner.os }}-php-8.1.31-${{ hashFiles('**/composer.json') }}
47+
restore-keys: |
48+
${{ runner.os }}-php-8.1.31-
49+
50+
- name: Install PHP deps
51+
if: steps.cache-php-deps.outputs.cache-hit != 'true'
52+
run: docker compose run --rm client composer install
53+
54+
- name: Run tests
55+
run: docker compose run --rm client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration --teamcity

.github/workflows/integration-test-cluster-neo4j-4.yml

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,72 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
php: ['8.1.31', '8.3.17']
14+
php: ["8.1.31", "8.3.17"]
1515
name: "Running on PHP ${{ matrix.php }} in a Neo4j 4.4 cluster"
1616

1717
steps:
1818
- uses: actions/checkout@v4
19+
20+
- name: Restore Neo4j Image Cache if it exists
21+
id: cache-docker-neo4j
22+
uses: actions/cache@v4
23+
with:
24+
path: ci/cache/docker/neo4j
25+
key: cache-docker-neo4j-4-enterprise
26+
27+
- name: Update Neo4j Image Cache if cache miss
28+
if: steps.cache-docker-neo4j.outputs.cache-hit != 'true'
29+
run: |
30+
docker pull neo4j:4.4-enterprise
31+
mkdir -p ci/cache/docker/neo4j
32+
docker image save neo4j:4.4-enterprise --output ./ci/cache/docker/neo4j/neo4j-4-enterprise.tar
33+
34+
- name: Use Neo4j Image Cache if cache hit
35+
if: steps.cache-docker-neo4j.outputs.cache-hit == 'true'
36+
run: docker image load --input ./ci/cache/docker/neo4j/neo4j-4-enterprise.tar
37+
38+
- name: Set up Docker Buildx
39+
uses: docker/setup-buildx-action@v2
40+
41+
- name: Build & cache client image
42+
uses: docker/build-push-action@v3
43+
with:
44+
context: .
45+
file: Dockerfile
46+
load: true
47+
push: false
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max
50+
build-args: PHP_VERSION=${{ matrix.php }}
51+
tags: integration-client:${{ matrix.php }}
52+
1953
- name: Populate .env
2054
run: |
2155
echo "PHP_VERSION=${{ matrix.php }}" > .env
22-
echo "CONNECTION=neo4j://neo4j:testtest@core1" >> .env
23-
- uses: hoverkraft-tech/[email protected]
24-
name: Start services
56+
echo "CONNECTION=neo4j://neo4j:testtest@server1" >> .env
57+
echo "CI=true" >> .env
58+
59+
- name: Cache PHP deps
60+
id: cache-php-deps
61+
uses: actions/cache@v4
2562
with:
26-
compose-file: './docker-compose-neo4j-4.yml'
27-
up-flags: '--build --remove-orphans'
28-
- name: Test
63+
path: vendor
64+
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
65+
restore-keys: |
66+
${{ runner.os }}-php-${{ matrix.php }}-
67+
68+
- name: Install PHP deps
69+
if: steps.cache-php-deps.outputs.cache-hit != 'true'
2970
run: |
30-
docker compose run --rm client composer install
31-
docker compose run --rm client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
71+
docker compose -f docker-compose-neo4j-4.yml run --rm client composer install
72+
73+
- name: Run integration tests
74+
run: |
75+
docker compose -f docker-compose-neo4j-4.yml up -d --no-build --remove-orphans --wait \
76+
server1 \
77+
server2 \
78+
server3 \
79+
server4
80+
81+
docker compose -f docker-compose-neo4j-4.yml run --rm client \
82+
./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration --teamcity

.github/workflows/integration-test-cluster-neo4j-5.yml

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,73 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
php: ['8.1.31', '8.3.17']
14+
php: ["8.1.31", "8.3.17"]
1515
name: "Running on PHP ${{ matrix.php }} with a Neo4j 5.20-enterprise cluster"
1616

1717
steps:
1818
- uses: actions/checkout@v4
19+
20+
- name: Restore Neo4j Image Cache if it exists
21+
id: cache-docker-neo4j
22+
uses: actions/cache@v4
23+
with:
24+
path: ci/cache/docker/neo4j
25+
key: cache-docker-neo4j-5-enterprise
26+
27+
- name: Update Neo4j Image Cache if cache miss
28+
if: steps.cache-docker-neo4j.outputs.cache-hit != 'true'
29+
run: |
30+
docker pull neo4j:5-enterprise
31+
mkdir -p ci/cache/docker/neo4j
32+
docker image save neo4j:5-enterprise --output ./ci/cache/docker/neo4j/neo4j-5-enterprise.tar
33+
34+
- name: Use Neo4j Image Cache if cache hit
35+
if: steps.cache-docker-neo4j.outputs.cache-hit == 'true'
36+
run: docker image load --input ./ci/cache/docker/neo4j/neo4j-5-enterprise.tar
37+
38+
- name: Set up Docker Buildx
39+
uses: docker/setup-buildx-action@v2
40+
41+
- name: Build & cache client image
42+
uses: docker/build-push-action@v3
43+
with:
44+
context: .
45+
file: Dockerfile
46+
load: true
47+
push: false
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max
50+
build-args: PHP_VERSION=${{ matrix.php }}
51+
tags: integration-client:${{ matrix.php }}
52+
1953
- name: Populate .env
2054
run: |
2155
echo "PHP_VERSION=${{ matrix.php }}" > .env
2256
echo "CONNECTION=neo4j://neo4j:testtest@server1" >> .env
23-
- uses: hoverkraft-tech/[email protected]
24-
name: Start services
57+
echo "CI=true" >> .env
58+
59+
- name: Cache PHP deps
60+
id: cache-php-deps
61+
uses: actions/cache@v4
2562
with:
26-
compose-file: './docker-compose.yml'
27-
up-flags: '--build --remove-orphans'
28-
- name: Test
63+
path: vendor
64+
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
65+
restore-keys: |
66+
${{ runner.os }}-php-${{ matrix.php }}-
67+
68+
- name: Install PHP deps
69+
if: steps.cache-php-deps.outputs.cache-hit != 'true'
2970
run: |
3071
docker compose run --rm client composer install
31-
docker compose run --rm client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
72+
73+
- name: Run integration tests
74+
run: |
75+
docker compose up -d --remove-orphans --wait --no-build \
76+
server1 \
77+
server2 \
78+
server3 \
79+
server4
80+
81+
# install PHP deps and run PHPUnit inside the client container
82+
docker compose run --rm client \
83+
./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration --teamcity

0 commit comments

Comments
 (0)