Skip to content

Commit 80656a4

Browse files
committed
move testkit dot yaml to new ci
1 parent a26f37e commit 80656a4

File tree

1 file changed

+58
-12
lines changed

1 file changed

+58
-12
lines changed

.github/workflows/testkit.yml

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Testkit
1+
name: Testkit Tests
22

33
on:
44
push:
@@ -9,24 +9,70 @@ on:
99
jobs:
1010
tests:
1111
runs-on: ubuntu-latest
12-
name: "Testkit"
12+
name: "Run Testkit Tests"
1313

1414
steps:
1515
- uses: actions/checkout@v4
16+
17+
- name: Restore Neo4j Image Cache if it exists
18+
id: cache-docker-neo4j
19+
uses: actions/cache@v4
20+
with:
21+
path: ci/cache/docker/neo4j
22+
key: cache-docker-neo4j-5-enterprise
23+
24+
- name: Update Neo4j Image Cache if cache miss
25+
if: steps.cache-docker-neo4j.outputs.cache-hit != 'true'
26+
run: |
27+
docker pull neo4j:5-enterprise
28+
mkdir -p ci/cache/docker/neo4j
29+
docker image save neo4j:5-enterprise --output ./ci/cache/docker/neo4j/neo4j-5-enterprise.tar
30+
31+
- name: Use Neo4j Image Cache if cache hit
32+
if: steps.cache-docker-neo4j.outputs.cache-hit == 'true'
33+
run: docker image load --input ./ci/cache/docker/neo4j/neo4j-5-enterprise.tar
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v2
37+
38+
- name: Build & cache client image
39+
uses: docker/build-push-action@v3
40+
with:
41+
context: .
42+
file: Dockerfile
43+
load: true
44+
push: false
45+
cache-from: type=gha
46+
cache-to: type=gha,mode=max
47+
build-args: PHP_VERSION=8.1
48+
tags: integration-client:8.1
49+
1650
- name: Populate .env
1751
run: |
18-
echo "PHP_VERSION=8.3.17" > .env
52+
echo "PHP_VERSION=8.1" > .env
1953
echo "CONNECTION=neo4j://neo4j:testtest@server1" >> .env
20-
- uses: hoverkraft-tech/[email protected]
21-
name: Start services
54+
55+
- name: Cache PHP deps
56+
id: cache-php-deps
57+
uses: actions/cache@v4
2258
with:
23-
compose-file: "./docker-compose.yml"
24-
up-flags: "--build --remove-orphans"
25-
down-flags: "-t 60 --remove-orphans"
26-
- name: Test
59+
path: vendor
60+
key: ${{ runner.os }}-php-8.1-${{ hashFiles('**/composer.json') }}
61+
restore-keys: |
62+
${{ runner.os }}-php-8.1-
63+
64+
- name: Install PHP deps
65+
if: steps.cache-php-deps.outputs.cache-hit != 'true'
2766
run: |
2867
docker compose run --rm client composer install
29-
# We need to restart the testkit_backend service since it relies on the previous step (composer install) to work
30-
docker compose up -d --force-recreate --build testkit_backend
31-
docker compose logs testkit_backend
68+
69+
- name: Run integration tests
70+
run: |
71+
docker compose up -d --remove-orphans --wait --no-build \
72+
server1 \
73+
server2 \
74+
server3 \
75+
server4 \
76+
testkit_backend
77+
3278
docker compose run --rm testkit ./testkit.sh

0 commit comments

Comments
 (0)