-
Notifications
You must be signed in to change notification settings - Fork 316
146 lines (143 loc) · 4.41 KB
/
build-latest.yaml
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
name: build-latest
on:
# workflow_dispatch:
# inputs:
# distro:
# description: Base image distro
# required: true
# default: debian
# imageVersion:
# description: Base distro image version/release
# required: true
# default: bookworm
# imageVariant:
# description: Base image variant
# required: true
# default: slim
workflow_dispatch:
pull_request:
branches:
- develop
push:
branches:
- develop
jobs:
run-scenario-tests:
runs-on: ubuntu-latest
strategy:
matrix:
postgresMajorVersion:
- 16
postgisMajorVersion:
- 3
postgisMinorRelease:
- 4
scenario:
- datadir_init
- streaming_replication
- collations
- extensions
- logical_replication
- init_scripts
- multiple_databases
include:
- distro: debian
imageVersion: bookworm
imageVariant: slim
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build image for testing
id: docker_build_testing_image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
push: false
load: true
tags: kartoza/postgis:manual-build
build-args: |
DISTRO=${{ matrix.distro }}
IMAGE_VERSION=${{ matrix.imageVersion }}
IMAGE_VARIANT=${{ matrix.imageVariant }}
LANGS=en_US.UTF-8,id_ID.UTF-8
GENERATE_ALL_LOCALE=0
POSTGRES_MAJOR_VERSION=${{ matrix.postgresMajorVersion }}
POSTGIS_MAJOR_VERSION=${{ matrix.postgisMajorVersion }}
POSTGIS_MINOR_VERSION=${{ matrix.postgisMinorRelease }}
cache-from: |
type=gha,scope=test
type=gha,scope=prod
type=gha,scope=base
cache-to: type=gha,scope=test
target: postgis-test
- name: Run scenario test ${{ matrix.scenario }}
working-directory: scenario_tests/${{ matrix.scenario }}
env:
COMPOSE_INTERACTIVE_NO_CLI: 1
PRINT_TEST_LOGS: 1
run: |
bash ./test.sh
push-internal-pr-images:
if: github.event.pull_request.base.repo.url == github.event.pull_request.head.repo.url
runs-on: ubuntu-latest
needs: [ run-scenario-tests ]
strategy:
matrix:
postgresMajorVersion:
- 16
postgisMajorVersion:
- 3
postgisMinorRelease:
- 4
include:
- distro: debian
imageVersion: bookworm
imageVariant: slim
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: ${{ secrets.DOCKERHUB_REPO}}/postgis
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
type=ref,event=pr
- name: Build image for testing
id: docker_build_testing_image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
push: true
tags: |
${{ steps.docker_meta.outputs.tags }}-${{ matrix.postgresMajorVersion }}-${{ matrix.postgisMajorVersion }}.${{ matrix.postgisMinorRelease }}
build-args: |
DISTRO=${{ matrix.distro }}
IMAGE_VERSION=${{ matrix.imageVersion }}
IMAGE_VARIANT=${{ matrix.imageVariant }}
LANGS=en_US.UTF-8,id_ID.UTF-8
GENERATE_ALL_LOCALE=0
POSTGRES_MAJOR_VERSION=${{ matrix.postgresMajorVersion }}
POSTGIS_MAJOR_VERSION=${{ matrix.postgisMajorVersion }}
POSTGIS_MINOR_VERSION=${{ matrix.postgisMinorRelease }}
cache-from: |
type=gha,scope=test
type=gha,scope=prod
type=gha,scope=base
cache-to: type=gha,scope=test
target: postgis-test