|
| 1 | +name: buildx Docker PostGIS CI (experimental) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + schedule: |
| 7 | + - cron: '15 5 * * 2' |
| 8 | + |
| 9 | +defaults: |
| 10 | + run: |
| 11 | + shell: bash |
| 12 | + |
| 13 | +jobs: |
| 14 | + |
| 15 | + make-docker-images: |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + # |
| 20 | + platforms: ['linux/arm64','linux/arm/v7','linux/arm/v6','linux/386','linux/ppc64le'] |
| 21 | + # |
| 22 | + # platforms: ['linux/arm64','linux/arm/v7','linux/arm/v6','linux/386','linux/mips64le','linux/ppc64le','linux/s390x'] |
| 23 | + # |
| 24 | + # comments: |
| 25 | + # 'linux/arm/v7' - default/debian: Unable to locate package postgresql-14-postgis-3; |
| 26 | + # 'linux/arm/v6' - default/debian: Unable to locate package postgresql-14-postgis-3; |
| 27 | + # 'linux/s390x' alpine: failed test. |
| 28 | + # 'linux/mips64le' alpine failed test. |
| 29 | + # |
| 30 | + postgres: [14] |
| 31 | + postgis: ['3.2'] |
| 32 | + variant: [alpine] |
| 33 | + include: |
| 34 | + |
| 35 | + - postgres: 14 |
| 36 | + postgis: '3.2' |
| 37 | + variant: 'default' |
| 38 | + platforms: 'linux/arm64' |
| 39 | + |
| 40 | + - postgres: 14 |
| 41 | + postgis: '3.2' |
| 42 | + variant: 'default' |
| 43 | + platforms: 'linux/ppc64le' |
| 44 | + |
| 45 | + name: ${{ matrix.platforms }} ${{ matrix.postgres }}-${{ matrix.postgis }} ${{ matrix.variant }} |
| 46 | + runs-on: ubuntu-latest |
| 47 | + |
| 48 | + env: |
| 49 | + VERSION: ${{ matrix.postgres }}-${{ matrix.postgis }} |
| 50 | + VARIANT: ${{ matrix.variant }} |
| 51 | + |
| 52 | + steps: |
| 53 | + |
| 54 | + - name: Checkout |
| 55 | + uses: actions/checkout@v3 |
| 56 | + |
| 57 | + - name: Set up QEMU |
| 58 | + uses: docker/setup-qemu-action@v2 |
| 59 | + |
| 60 | + - name: Set up Docker Buildx |
| 61 | + uses: docker/setup-buildx-action@v2 |
| 62 | + |
| 63 | + - name: "docker buildx inspect --bootstrap" |
| 64 | + run: docker buildx inspect --bootstrap |
| 65 | + |
| 66 | + - name: "docker buildx ls" |
| 67 | + run: docker buildx ls |
| 68 | + |
| 69 | + - if: ${{ env.VARIANT == 'alpine' }} |
| 70 | + run: docker pull --platform=${{ matrix.platforms }} postgres:${{ matrix.postgres }}-alpine3.16 && docker inspect postgres:${{ matrix.postgres }}-alpine3.16 |
| 71 | + env: |
| 72 | + DOCKER_DEFAULT_PLATFORM: ${{ matrix.platforms }} |
| 73 | + PLATFORM: ${{ matrix.platforms }} |
| 74 | + |
| 75 | + - name: Build docker image for ${{ env.VERSION }} ${{ env.VARIANT }} ${{ env.DOCKER_DEFAULT_PLATFORM }} |
| 76 | + run: make test |
| 77 | + env: |
| 78 | + DOCKER_DEFAULT_PLATFORM: ${{ matrix.platforms }} |
| 79 | + PLATFORM: ${{ matrix.platforms }} |
| 80 | + POSTGRES_TEST_TRIES: 42 |
| 81 | + POSTGRES_TEST_SLEEP: 2 |
| 82 | + |
| 83 | + - name: "docker images" |
| 84 | + run: docker images |
| 85 | + |
| 86 | + - if: ${{ env.VARIANT == 'default' }} |
| 87 | + run: docker inspect postgis/postgis:${{ env.VERSION }} |
| 88 | + |
| 89 | + - if: ${{ env.VARIANT == 'alpine' }} |
| 90 | + run: docker inspect postgis/postgis:${{ env.VERSION }}-${{ env.VARIANT }} |
| 91 | + |
| 92 | +#--- temp security commenting ----# |
| 93 | +# - name: Login to dockerhub |
| 94 | +# uses: docker/login-action@v1 |
| 95 | +# if: ${{ (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') }} |
| 96 | +# with: |
| 97 | +# username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 98 | +# password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} |
| 99 | +# |
| 100 | +# - name: Push docker image to dockerhub |
| 101 | +# if: ${{ (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') }} |
| 102 | +# env: |
| 103 | +# DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} |
| 104 | +# DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 105 | +# DOCKERHUB_ACCESS_TOKEN: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} |
| 106 | +# DOCKER_DEFAULT_PLATFORM: ${{ matrix.platforms }} |
| 107 | +# PLATFORM: ${{ matrix.platforms }} |
| 108 | +# run: make push |
0 commit comments