Skip to content

up: Update php.yml, enable unit tests on php8.2 #42

up: Update php.yml, enable unit tests on php8.2

up: Update php.yml, enable unit tests on php8.2 #42

Workflow file for this run

name: Unit-tests
on:
push:
paths:
- '**.php'
- 'composer.json'
- '**.yml'
# Trigger the workflow on any pull request
pull_request:
jobs:
test:
name: Test on php ${{ matrix.php}} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: true
matrix:
php: [ 8.1, 8.2] # 7.1, 7.2,
os: [ubuntu-latest] # windows-latest, macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# usage refer https://github.com/shivammathur/setup-php
- name: Setup PHP
timeout-minutes: 5
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php}}
tools: pecl, php-cs-fixer, phpunit:${{ matrix.phpunit }}
extensions: mbstring, dom, fileinfo, mysql, openssl, igbinary, redis # , swoole-4.4.19 #optional, setup extensions
ini-values: post_max_size=56M, short_open_tag=On #optional, setup php.ini configuration
coverage: none #optional, setup coverage driver: xdebug, none
- name: Display Env
run: env
- name: Install dependencies
run: composer install --no-progress
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md
- name: Run unit tests
# run: composer run test
run: phpunit -vv