docker-postgis/.github/workflows/build-latest.yaml

145 wiersze
4.4 KiB
YAML
Czysty Zwykły widok Historia

2021-01-27 10:36:24 +00:00
name: build-latest
on:
2021-01-27 12:50:49 +00:00
# workflow_dispatch:
# inputs:
# distro:
# description: Base image distro
# required: true
# default: debian
# imageVersion:
# description: Base distro image version/release
# required: true
# default: bullseye
# imageVariant:
# description: Base image variant
# required: true
# default: slim
workflow_dispatch:
2021-01-27 12:50:49 +00:00
pull_request:
2021-01-30 10:33:47 +00:00
branches:
- develop
push:
branches:
- develop
2021-01-27 10:36:24 +00:00
jobs:
2021-01-27 12:50:49 +00:00
run-scenario-tests:
runs-on: ubuntu-latest
strategy:
matrix:
postgresMajorVersion:
- 15
2021-01-27 13:04:19 +00:00
postgisMajorVersion:
- 3
postgisMinorRelease:
2022-06-23 08:13:11 +00:00
- 3
2021-01-27 12:50:49 +00:00
scenario:
- datadir_init
- streaming_replication
- collations
- extensions
- logical_replication
include:
- distro: debian
imageVersion: bullseye
imageVariant: slim
steps:
- uses: actions/checkout@v3
2021-01-27 12:50:49 +00:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
2021-01-27 12:50:49 +00:00
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
2021-01-27 18:06:59 +00:00
- name: Build image for testing
id: docker_build_testing_image
uses: docker/build-push-action@v3
2021-01-27 12:50:49 +00:00
with:
context: .
file: Dockerfile
push: false
2021-01-27 15:48:24 +00:00
load: true
2021-01-27 16:10:25 +00:00
tags: kartoza/postgis:manual-build
2021-01-27 12:50:49 +00:00
build-args: |
DISTRO=${{ matrix.distro }}
IMAGE_VERSION=${{ matrix.imageVersion }}
IMAGE_VARIANT=${{ matrix.imageVariant }}
2021-01-27 18:59:12 +00:00
LANGS=en_US.UTF-8,id_ID.UTF-8
2021-01-27 18:06:59 +00:00
GENERATE_ALL_LOCALE=0
2021-01-27 13:04:19 +00:00
POSTGRES_MAJOR_VERSION=${{ matrix.postgresMajorVersion }}
POSTGIS_MAJOR_VERSION=${{ matrix.postgisMajorVersion }}
POSTGIS_MINOR_VERSION=${{ matrix.postgresMinorVersion }}
2021-11-28 05:38:57 +00:00
cache-from: |
type=gha,scope=test
type=gha,scope=prod
type=gha,scope=base
cache-to: type=gha,scope=test
2021-01-27 18:06:59 +00:00
target: postgis-test
2021-01-27 12:50:49 +00:00
- name: Run scenario test ${{ matrix.scenario }}
working-directory: scenario_tests/${{ matrix.scenario }}
2021-01-27 19:19:12 +00:00
env:
COMPOSE_INTERACTIVE_NO_CLI: 1
2021-01-27 19:42:40 +00:00
PRINT_TEST_LOGS: 1
2021-01-27 12:50:49 +00:00
run: |
bash ./test.sh
2021-01-30 01:48:53 +00:00
push-internal-pr-images:
2022-02-14 07:36:52 +00:00
if: github.event.pull_request.base.repo.url == github.event.pull_request.head.repo.url
2021-01-30 01:48:53 +00:00
runs-on: ubuntu-latest
needs: [ run-scenario-tests ]
2021-01-30 01:48:53 +00:00
strategy:
matrix:
postgresMajorVersion:
- 15
2021-01-30 01:48:53 +00:00
postgisMajorVersion:
- 3
postgisMinorRelease:
2022-06-23 08:13:11 +00:00
- 3
2021-01-30 01:48:53 +00:00
include:
- distro: debian
imageVersion: bullseye
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
2021-01-30 01:48:53 +00:00
- name: Login to DockerHub
uses: docker/login-action@v2
2021-01-30 01:48:53 +00:00
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v3
2021-01-30 01:48:53 +00:00
with:
images: ${{ secrets.DOCKERHUB_REPO}}/postgis
tags: |
2022-02-14 07:36:52 +00:00
type=semver,pattern={{version}}
type=ref,event=branch
type=ref,event=pr
2021-01-30 01:48:53 +00:00
- name: Build image for testing
id: docker_build_testing_image
uses: docker/build-push-action@v3
2021-01-30 01:48:53 +00:00
with:
context: .
file: Dockerfile
push: true
tags: |
${{ steps.docker_meta.outputs.tags }}-${{ matrix.postgresMajorVersion }}-${{ matrix.postgisMajorVersion }}.${{ matrix.postgisMinorRelease }}
2021-01-30 01:48:53 +00:00
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.postgresMinorVersion }}
2021-11-28 05:38:57 +00:00
cache-from: |
type=gha,scope=test
type=gha,scope=prod
type=gha,scope=base
cache-to: type=gha,scope=test
2021-01-30 01:48:53 +00:00
target: postgis-test