Fix: use alternate port on ARM runners to avoid conflict and Postgres 14 on macos #258
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | ||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| paths-ignore: | ||
| - '**.md' | ||
| pull_request: | ||
| branches: [ main ] | ||
| schedule: | ||
| - cron: "0 8 * * SUN" | ||
| workflow_dispatch: | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| jobs: | ||
| default: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: | ||
| # Linux | ||
| - ubuntu-24.04 | ||
| - ubuntu-22.04 | ||
| # Linux - ARM | ||
| - ubuntu-24.04-arm | ||
| - ubuntu-22.04-arm | ||
| # Legacy | ||
| - macos-13 | ||
| # M1 CPU | ||
| - macos-14 | ||
| - macos-15 | ||
| - macos-26 | ||
| # Windows | ||
| - windows-2025 | ||
| - windows-2022 | ||
| # Windows ARM | ||
| - windows-11-arm | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Resolve PostgreSQL port | ||
| shell: bash | ||
| id: resolve-port-and-version | ||
| run: | | ||
| # fix arm64 port collision | ||
| if [[ "$(uname -s)" == "Linux" && "$(uname -m)" == "aarch64" ]]; then | ||
| echo "port=34837" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "port=5432" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| # fix brew only supports postgres 14 with postgis | ||
| if [[ "$RUNNER_OS" == "macOS" ]]; then | ||
| echo "postgres-version=14" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "postgres-version=16" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| - name: Run setup-postgis | ||
| id: postgres | ||
| uses: ./ | ||
| with: | ||
| port: ${{ steps.resolve-port.outputs.port }} | ||
| postgres-version: "${{ steps.preflight.outputs.postgres-version }}" | ||
| - name: Test PostGIS with connection URI | ||
| run: psql -v ON_ERROR_STOP=1 -c 'SELECT PostGIS_Full_Version();' '${{ steps.postgres.outputs.connection-uri }}' | ||
| - name: Test PostGIS with service name | ||
| run: psql -v ON_ERROR_STOP=1 -c 'SELECT PostGIS_Full_Version();' | ||
| env: | ||
| PGSERVICE: ${{ steps.postgres.outputs.service-name }} | ||
| parametrized: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: | ||
| - ubuntu-latest | ||
| - windows-latest | ||
| - macos-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Run setup-postgis | ||
| uses: ./ | ||
| with: | ||
| username: yoda | ||
| password: GrandMaster | ||
| database: jedi_order | ||
| port: 34837 | ||
| postgres-version: 17 | ||
| postgis_version: 3.5.0 | ||
| id: postgres | ||
| - name: Test PostGIS with connection URI | ||
| run: psql -v ON_ERROR_STOP=1 -c 'SELECT PostGIS_Full_Version();' '${{ steps.postgres.outputs.connection-uri }}' | ||
| - name: Test PostGIS with service name | ||
| run: psql -v ON_ERROR_STOP=1 -c 'SELECT PostGIS_Full_Version();' | ||
| env: | ||
| PGSERVICE: ${{ steps.postgres.outputs.service-name }} | ||
| - name: Verify PostGIS 3.5.0 installation on Windows | ||
| if: matrix.os == 'windows-latest' | ||
| run: | | ||
| psql -v ON_ERROR_STOP=1 -c "SELECT PostGIS_Full_Version();" "${{ steps.postgres.outputs.connection-uri }}" | findstr /C:"POSTGIS=3.5.0 3.5.0" | ||