Skip to content

better-typing-v2 (#22) #168

better-typing-v2 (#22)

better-typing-v2 (#22) #168

Workflow file for this run

name: "Tests"
on:
push:
branches: ['master']
pull_request:
jobs:
test:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
experimental:
- false
php:
- "8.3"
env:
MYSQL_USER: "zftest"
MYSQL_PASSWORD: "zftest"
MYSQL_DATABASE: "zftest"
MYSQL_HOST: "127.0.0.1"
POSTGRES_USER: "zftest"
POSTGRES_PASSWORD: "zftest"
POSTGRES_DB: "zftest"
POSTGRES_HOST: "127.0.0.1"
# Default locales are: C C.UTF-8 POSIX en_US.utf8
LOCALES: "fr_FR@euro fr_FR fr_BE.UTF-8 de en_US"
services:
memcache:
image: memcached:1-alpine
ports:
- 11211:11211
mysql:
image: mysql/mysql-server:5.7
ports:
- 3306:3306
env:
MYSQL_USER: ${{ env.MYSQL_USER }}
MYSQL_PASSWORD: ${{ env.MYSQL_PASSWORD }}
MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }}
MYSQL_ALLOW_EMPTY_PASSWORD: "1"
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
postgres:
image: postgres:12
ports:
- 5432:5432
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ env.POSTGRES_DB }}
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: display_errors=off, log_errors=on
tools: cs2pr
extensions: :xdebug, ctype, dom, gd, iconv, ldap, mbstring, reflection, session, simplexml, spl, xml, zlib, memcache, pdo_sqlite, bcmath
env:
# https://github.com/shivammathur/setup-php/issues/407#issuecomment-773675741
fail-fast: true
# https://github.com/zf1s/zf1/pull/6#issuecomment-495397170
- name: Validate composer.json for all packages
run: |
for json in composer.json packages/*/composer.json; do echo COMPOSER=$json; done | parallel env {} composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Lint PHP source files
run: |
composer lint.checkstyle | cs2pr
- name: php-cs-fixer
run: vendor/bin/php-cs-fixer fix --dry-run
- name: Setup environment for PHPUnit
run: |
cp tests/TestConfiguration.ci.php tests/TestConfiguration.php
echo "Existing locales"
locale -a
sudo apt-get update && sudo apt-get install tzdata locales -y && sudo locale-gen $LOCALES
echo "All languages..."
locale -a
- name: "Run PHPUnit tests (Experimental: ${{ matrix.experimental }})"
env:
FAILURE_ACTION: "${{ matrix.experimental == true }}"
run: vendor/bin/phpunit --verbose || $FAILURE_ACTION
# vim:ft=yaml:et:ts=2:sw=2