Skip to content

Commit a26f37e

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/testkit
2 parents 87f160b + c94c0f8 commit a26f37e

12 files changed

+373
-267
lines changed
Lines changed: 54 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,54 @@
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+
40+
- name: Cache PHP deps
41+
id: cache-php-deps
42+
uses: actions/cache@v4
43+
with:
44+
path: vendor
45+
key: ${{ runner.os }}-php-8.1.31-${{ hashFiles('**/composer.json') }}
46+
restore-keys: |
47+
${{ runner.os }}-php-8.1.31-
48+
49+
- name: Install PHP deps
50+
if: steps.cache-php-deps.outputs.cache-hit != 'true'
51+
run: docker compose run --rm client composer install
52+
53+
- name: Run tests
54+
run: docker compose run --rm client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration

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

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,66 @@ jobs:
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+
58+
- name: Cache PHP deps
59+
id: cache-php-deps
60+
uses: actions/cache@v4
2561
with:
26-
compose-file: "./docker-compose-neo4j-4.yml"
27-
up-flags: "--build --remove-orphans"
28-
- name: Test
62+
path: vendor
63+
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
64+
restore-keys: |
65+
${{ runner.os }}-php-${{ matrix.php }}-
66+
67+
- name: Install PHP deps
68+
if: steps.cache-php-deps.outputs.cache-hit != 'true'
2969
run: |
3070
docker compose -f docker-compose-neo4j-4.yml run --rm client composer install
31-
docker compose -f docker-compose-neo4j-4.yml run --rm client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
71+
72+
- name: Run integration tests
73+
run: |
74+
docker compose -f docker-compose-neo4j-4.yml up -d --no-build --remove-orphans --wait \
75+
server1 \
76+
server2 \
77+
server3 \
78+
server4
79+
80+
docker compose -f docker-compose-neo4j-4.yml run --rm client \
81+
./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration

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

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,67 @@ jobs:
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+
58+
- name: Cache PHP deps
59+
id: cache-php-deps
60+
uses: actions/cache@v4
2561
with:
26-
compose-file: "./docker-compose.yml"
27-
up-flags: "--build --remove-orphans"
28-
- name: Test
62+
path: vendor
63+
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
64+
restore-keys: |
65+
${{ runner.os }}-php-${{ matrix.php }}-
66+
67+
- name: Install PHP deps
68+
if: steps.cache-php-deps.outputs.cache-hit != 'true'
2969
run: |
3070
docker compose run --rm client composer install
31-
docker compose run --rm client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration
71+
72+
- name: Run integration tests
73+
run: |
74+
docker compose up -d --remove-orphans --wait --no-build \
75+
server1 \
76+
server2 \
77+
server3 \
78+
server4
79+
80+
# install PHP deps and run PHPUnit inside the client container
81+
docker compose run --rm client \
82+
./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration

0 commit comments

Comments
 (0)