Skip to content

feat!: remove deprecations scheduled for v4.0 #614

feat!: remove deprecations scheduled for v4.0

feat!: remove deprecations scheduled for v4.0 #614

name: Integration Tests
on:
push:
branches:
- main
paths-ignore:
- '.github/actions/release-please/**'
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: read
jobs:
should-run:
runs-on: ubuntu-latest
outputs:
run: ${{ steps.check.outputs.run }}
steps:
- name: Skip for release-please
id: check
run: |
if [ "${{ github.event.pull_request.user.id }}" = "41898282" ]; then
echo "run=false" >> $GITHUB_OUTPUT
echo "::notice::Skipping integration tests - this a release-please bot's interaction"
else
echo "run=true" >> $GITHUB_OUTPUT
echo "::notice::integration tests will execute - the actor is not the release-please bot"
fi
integration-tests:
needs: should-run
if: needs.should-run.outputs.run == 'true'
runs-on: ubuntu-latest
name: "PostgreSQL ${{ matrix.postgres }} + PostGIS ${{ matrix.postgis }} + PHP ${{ matrix.php }}"
strategy:
fail-fast: ${{ github.event_name == 'pull_request' }}
matrix:
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
postgis: ['3.4', '3.5', '3.6']
postgres: ['16', '17', '18']
exclude:
# PostgreSQL 16: Docker images support only for PostGIS 3.4, 3.5
- postgres: '16'
postgis: '3.6'
# PostgreSQL 18: Docker images support only for PostGIS 3.6
- postgres: '18'
postgis: '3.4'
- postgres: '18'
postgis: '3.5'
include:
# Code coverage on the latest stable combination
- php: '8.5'
postgres: '18'
postgis: '3.6'
calculate-code-coverage: true
services:
postgres:
image: postgis/postgis:${{ matrix.postgres }}-${{ matrix.postgis }}-alpine
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres_doctrine_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
-e POSTGRES_INITDB_ARGS="--data-checksums"
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Set up PHP
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2
with:
php-version: ${{ matrix.php }}
coverage: ${{ matrix.calculate-code-coverage == true && 'xdebug' || 'none' }}
extensions: ctype, json, mbstring, pdo_pgsql
tools: composer
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Get composer cache directory
id: composer-cache-dir
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer packages
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
${{ steps.composer-cache-dir.outputs.dir }}
vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-composer-
${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress
- name: Install PostgreSQL client tools
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client
- name: Verify PostgreSQL connection and setup
run: |
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres_doctrine_test -c "CREATE SCHEMA IF NOT EXISTS test; SELECT PostGIS_Version();"
- name: Run integration test suite
run: |
if [ "${{ matrix.calculate-code-coverage }}" = "true" ]; then
XDEBUG_MODE=coverage composer run-integration-tests
else
composer run-integration-tests -- --no-coverage
fi
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_DB: postgres_doctrine_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
- name: Upload coverage results to Coveralls
if: matrix.calculate-code-coverage == true
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2
env:
COVERALLS_SERVICE_NAME: github
COVERALLS_SERVICE_NUMBER: ${{ github.sha }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: ./var/logs/test-coverage/integration/clover.xml
parallel: true
flag-name: "Integration"
fail-on-error: false