-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathintegration-test-single-server.yml
More file actions
152 lines (122 loc) · 5.04 KB
/
integration-test-single-server.yml
File metadata and controls
152 lines (122 loc) · 5.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Integration Tests
on:
push:
branches:
- main
pull_request:
jobs:
tests-v4:
runs-on: ubuntu-latest
strategy:
matrix:
php: ["8.1.31", "8.3.17"]
name: "Running on PHP ${{ matrix.php }} with a Neo4j 4 instance connecting over all available protocols"
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: Populate .env
run: |
echo "PHP_VERSION=${{ matrix.php }}" > .env
echo "CI=true" >> .env
- 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: Cache PHP deps
id: cache-php-deps
uses: actions/cache@v4
with:
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 tests Neo4j 4
run: |
echo "PHP_VERSION=${{ matrix.php }}" > .env
echo "CONNECTION=bolt://neo4j:testtest@neo4j" >> .env
echo "CI=true" >> .env
docker compose -f docker-compose-neo4j-4.yml up -d --build --remove-orphans --wait neo4j
docker compose -f docker-compose-neo4j-4.yml run --rm \
client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration --teamcity
echo "PHP_VERSION=${{ matrix.php }}" > .env
echo "CONNECTION=neo4j://neo4j:testtest@neo4j" >> .env
echo "CI=true" >> .env
docker compose -f docker-compose-neo4j-4.yml run --rm \
client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration --teamcity
tests-v5:
runs-on: ubuntu-latest
strategy:
matrix:
php: ["8.1.31", "8.3.17"]
name: "Running on PHP ${{ matrix.php }} with a Neo4j 5 instance connecting over all available protocols"
steps:
- uses: actions/checkout@v4
- name: Populate .env
run: |
echo "PHP_VERSION=${{ matrix.php }}" > .env
- 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-community
- name: Update Neo4j Image Cache if cache miss
if: steps.cache-docker-neo4j.outputs.cache-hit != 'true'
run: |
docker pull neo4j:5.23-community
mkdir -p ci/cache/docker/neo4j
docker image save neo4j:5.23-community --output ./ci/cache/docker/neo4j/neo4j-5-community.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-community.tar
- name: Cache PHP deps
id: cache-php-deps
uses: actions/cache@v4
with:
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 tests Neo4j 5
run: |
echo "PHP_VERSION=${{ matrix.php }}" > .env
echo "CONNECTION=bolt://neo4j:testtest@neo4j" >> .env
echo "CI=true" >> .env
docker compose up -d --build --remove-orphans --wait neo4j
docker compose run --rm \
client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration --teamcity
echo "PHP_VERSION=${{ matrix.php }}" > .env
echo "CONNECTION=neo4j://neo4j:testtest@neo4j" >> .env
echo "CI=true" >> .env
docker compose run --rm \
client ./vendor/bin/phpunit -c phpunit.xml.dist --testsuite Integration --teamcity
docker compose down --remove-orphans --volumes