Skip to content

Add support for PHP 8.0 #6

Add support for PHP 8.0

Add support for PHP 8.0 #6

Workflow file for this run

name: Ci suite
on: [push, pull_request]
jobs:
symfony:
name: PHPUnit tests (PHP ${{ matrix.php-version }} - Postgres ${{ matrix.postgres-version }})
runs-on: ubuntu-latest
# Docs: https://docs.github.com/en/actions/using-containerized-services
services:
postgres:
image: postgres:${{ matrix.postgres-version }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 1s --health-timeout 3s --health-retries 3
strategy:
fail-fast: false
matrix:
php-version: ['7.4', '8.0']
postgres-version: ['11.20-alpine', '13.11-alpine', '15.3-alpine']
steps:
- name: Checkout
uses: actions/checkout@v3
# Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: phpunit-bridge
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, pgsql, zip
coverage: xdebug
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
# Without this step `git add .` command will result in exit code 128.
# This ensures the comitter info is set, for now prefil with some exiting
# variables in GitHub actions.
- name: Set committer info
id: committer-info
run: |
git config --global user.email ${GITHUB_ACTOR_ID}[email protected]
git config --global user.name $GITHUB_ACTOR
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Run Migration
run: |
php bin/console doctrine:migrations:migrate
php bin/console messenger:setup-transports
env:
DATABASE_URL: postgres://postgres:[email protected]:${{ job.services.postgres.ports[5432] }}/postgres?charset=UTF-8
- name: Run tests
run: git status && php vendor/bin/phpunit tests/Unit/Service/PackageSynchronizer/ComposerPackageSynchronizerTest.php --testdox --filter testSynchronizePackageWithGitLabToken
env:
DATABASE_URL: postgres://postgres:[email protected]:${{ job.services.postgres.ports[5432] }}/postgres?charset=UTF-8