@@ -12,27 +12,63 @@ jobs:
1212 strategy :
1313 fail-fast : false
1414 matrix :
15- age_image :
16- - release_PG16_1.5.0
17- - release_PG16_1.6.0
18- - dev_snapshot_PG17
15+ include :
16+ - age_image : release_PG16_1.5.0
17+ type : apache
18+ - age_image : release_PG16_1.6.0
19+ type : apache
20+ - age_image : dev_snapshot_PG17
21+ type : apache
22+ - age_image : ghcr.io/konnektr-io/age:16-1.5.0-standard-bookworm
23+ type : cnpg
24+ - age_image : ghcr.io/konnektr-io/age:16-1.5.0-standard-trixie
25+ type : cnpg
26+ - age_image : ghcr.io/konnektr-io/age:16-1.6.0-standard-bookworm
27+ type : cnpg
28+ - age_image : ghcr.io/konnektr-io/age:16-1.6.0-standard-trixie
29+ type : cnpg
30+ - age_image : ghcr.io/konnektr-io/age:17-1.6.0-standard-trixie
31+ type : cnpg
1932 steps :
33+ - name : Run CNPG AGE init SQL
34+ if : matrix.type == 'cnpg'
35+ run : |
36+ for i in {1..30}; do
37+ if docker exec postgres-test-cnpg pg_isready -U app -d app; then
38+ echo "PostgreSQL is ready for init";
39+ break;
40+ fi;
41+ echo "Waiting for PostgreSQL (init)...";
42+ sleep 5;
43+ done
44+ docker exec -u app postgres-test-cnpg psql -U app -d app -c "CREATE EXTENSION age;"
45+ docker exec -u app postgres-test-cnpg psql -U app -d app -c "GRANT SELECT ON ag_catalog.ag_graph TO app;"
46+ docker exec -u app postgres-test-cnpg psql -U app -d app -c "GRANT USAGE ON SCHEMA ag_catalog TO app;"
2047 - name : Checkout
2148 uses : actions/checkout@v4
2249
2350 - name : Start PostgreSQL with AGE extension
2451 run : |
25- docker run --name postgres-test-${{ matrix.age_image }} \
26- -e POSTGRES_USER=postgres \
27- -e POSTGRES_PASSWORD=postgres \
28- -e POSTGRES_DB=agedotnet_tests \
29- -p 5432:5432 \
30- -d apache/age:${{ matrix.age_image }}
52+ if [ "${{ matrix.type }}" = "cnpg" ]; then
53+ docker run --name postgres-test-cnpg \
54+ -e POSTGRES_USER=app \
55+ -e POSTGRES_PASSWORD=app \
56+ -e POSTGRES_DB=app \
57+ -p 5432:5432 \
58+ -d ${{ matrix.age_image }}
59+ else
60+ docker run --name postgres-test-${{ matrix.age_image }} \
61+ -e POSTGRES_USER=app \
62+ -e POSTGRES_PASSWORD=app \
63+ -e POSTGRES_DB=app \
64+ -p 5432:5432 \
65+ -d apache/age:${{ matrix.age_image }}
66+ fi
3167
3268 - name : Wait for PostgreSQL to be ready
3369 run : |
3470 for i in {1..30}; do
35- if docker exec postgres-test-${{ matrix.age_image }} pg_isready -U postgres -d agedotnet_tests ; then
71+ if docker exec postgres-test-${{ matrix.age_image }} pg_isready -U postgres -d app ; then
3672 echo "PostgreSQL is ready";
3773 sleep 5;
3874 exit 0;
5894 run : dotnet build --no-restore
5995
6096 - name : Test with dotnet
61- run : dotnet test --logger 'GitHubActions' --logger 'console;verbosity=normal' --blame-hang --blame-hang-timeout 5m
97+ run : |
98+ if [ "${{ matrix.type }}" = "cnpg" ]; then
99+ export CNPG_TEST=true
100+ fi
101+ dotnet test --logger 'GitHubActions' --logger 'console;verbosity=normal' --blame-hang --blame-hang-timeout 5m
62102
63103 - name : Stop PostgreSQL container
64104 if : always()
0 commit comments