|
1 |
| -name: Testkit |
| 1 | +name: Testkit Tests |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
|
9 | 9 | jobs:
|
10 | 10 | tests:
|
11 | 11 | runs-on: ubuntu-latest
|
12 |
| - name: "Testkit" |
| 12 | + name: "Run Testkit Tests" |
13 | 13 |
|
14 | 14 | steps:
|
15 | 15 | - 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 | + |
16 | 50 | - name: Populate .env
|
17 | 51 | run: |
|
18 |
| - echo "PHP_VERSION=8.3.17" > .env |
| 52 | + echo "PHP_VERSION=8.1" > .env |
19 | 53 | 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 |
22 | 58 | 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' |
27 | 66 | run: |
|
28 | 67 | 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 | +
|
32 | 78 | docker compose run --rm testkit ./testkit.sh
|
0 commit comments