Skip to content

test support for PHP 8.3 #195

test support for PHP 8.3

test support for PHP 8.3 #195

Workflow file for this run

# Copyright (c) 2020-2021 Afterpay Corporate Services Pty Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# See https://help.github.com/en/actions/configuring-and-managing-workflows
# See https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Build
on:
push:
branches:
- main
- 'release/**'
paths-ignore:
- 'README.md'
- 'sample.env.php'
- '.gitignore'
pull_request:
branches:
- main
- 'release/**'
paths-ignore:
- 'README.md'
- 'sample.env.php'
- '.gitignore'
jobs:
build:
# Runner base image (Operating System).
# See https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
include:
- php: '5.6'
mysql: '5.6'
- php: '7.0'
mysql: '5.7'
- php: '7.1'
mysql: '5.7'
- php: '7.2'
mysql: '5.7'
- php: '7.3'
mysql: '5.7'
- php: '7.4'
mysql: '8.0'
- php: '8.0'
mysql: '8.0'
- php: '8.1'
mysql: '8.0'
- php: '8.2'
mysql: '8.0'
- php: '8.3'
mysql: '8.0'
fail-fast: false
name: PHP ${{ matrix.php }}
services:
# Install the appropriate version of MySQL to work with each PHP build, as a service image.
# See https://hub.docker.com/_/mysql
mysql:
image: mysql:${{ matrix.mysql }}
env:
MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: Validate composer.json and composer.lock
run: composer validate
# Install multiple versions of PHP, each in its own independent build.
# See https://github.com/marketplace/actions/setup-php-action
- name: Install PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, mysqli
coverage: none
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
# Test coding standards against the PSR-12 coding standard using PHPCS
# See https://www.php-fig.org/psr/psr-12/
# See https://github.com/squizlabs/PHP_CodeSniffer
- name: Test against the PSR-12 coding standard
run: composer lint
- name: Run unit test suite
run: composer test-unit
- name: Run service test suite
env:
DB_API: mysqli
DB_HOST: 127.0.0.1
DB_PORT: ${{ job.services.mysql.ports[ 3306 ] }}
DB_USER: ${{ secrets.MYSQL_USER }}
DB_PASS: ${{ secrets.MYSQL_PASSWORD }}
run: composer test-service