Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 46 additions & 10 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,38 @@
name: Test

on: [push]
on:
pull_request:
branches: ["master"]
paths-ignore:
- "README.md"
- ".gitignore"
- "LICENSE.md"
push:
branches: ["master"]

jobs:
test:

name: Test PHP ${{ matrix.php-versions }}
name: Test PHP ${{ matrix.php.version }} ${{ matrix.php.composer }}
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.0', '8.1', '8.2', '8.3']
php:
- version: '8.1'
composer: --prefer-lowest
- version: '8.2'
composer: --prefer-lowest
- version: '8.3'
composer: --prefer-lowest
#- version: '8.4'
# composer: --prefer-lowest
- version: '8.1'
composer: --prefer-stable
- version: '8.2'
composer: --prefer-stable
- version: '8.3'
composer: --prefer-stable
- version: '8.4'
composer: --prefer-stable

steps:
- uses: actions/checkout@v4
Expand All @@ -21,7 +45,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
php-version: ${{ matrix.php.version }}
extensions: curl, mbstring, intl, libxml, simplexml
coverage: xdebug

Expand All @@ -38,24 +62,36 @@ jobs:
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: (test -d vendor && echo vendor directory exists) || composer install --prefer-dist --no-progress --no-suggest
run: (test -d vendor && echo vendor directory exists) || composer update --no-interaction --no-scripts --no-ansi ${{ matrix.php.composer }}

- name: Run PHPUnit
run: vendor/bin/phpunit --coverage-text --coverage-clover clover.xml

- name: Static Analysis
if: matrix.php.version == '8.3' && matrix.php.composer == '--prefer-stable'
run: composer analyse

- name: "[Coveralls] Extract branch name"
if: matrix.php-versions == '8.3'
if: matrix.php.version == '8.3' && matrix.php.composer == '--prefer-stable'
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
run: |
if [ -n "${GITHUB_HEAD_REF}" ]; then
echo "Branch from PR: ${GITHUB_HEAD_REF}"
echo "branch=${GITHUB_HEAD_REF}" >> $GITHUB_OUTPUT
else
branch_name="${GITHUB_REF#refs/heads/}"
echo "Branch from push: ${branch_name}"
echo "branch=${branch_name}" >> $GITHUB_OUTPUT
fi
id: extract_branch

- name: "[Coveralls] Checkout branch"
if: matrix.php-versions == '8.3'
if: matrix.php.version == '8.3' && matrix.php.composer == '--prefer-stable'
shell: bash
run: git fetch && git checkout ${{ steps.extract_branch.outputs.branch }}

- name: "[Coveralls] Send report"
if: matrix.php-versions == '8.3'
if: matrix.php.version == '8.3' && matrix.php.composer == '--prefer-stable'
run: ./vendor/bin/php-coveralls -v -x clover.xml -o coveralls-upload.json
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 0 additions & 23 deletions .scrutinizer.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ With this package I'm trying to improve the crappy IGFS CG PHP Library provided
[![Latest Stable Version](https://poser.pugx.org/mattiabasone/pagonline/v/stable)](https://packagist.org/packages/mattiabasone/pagonline)
[![Total Downloads](https://poser.pugx.org/mattiabasone/pagonline/downloads)](https://packagist.org/packages/mattiabasone/pagonline)
[![Build Status](https://img.shields.io/github/actions/workflow/status/mattiabasone/PagOnline/.github/workflows/php.yml?branch=master)](https://github.com/mattiabasone/PagOnline/actions?query=workflow%3ATest)
[![Coverage Status](https://scrutinizer-ci.com/g/mattiabasone/PagOnline/badges/coverage.png?b=master)](https://coveralls.io/github/mattiabasone/PagOnline)
[![Coverage Status](https://coveralls.io/repos/github/mattiabasone/PagOnline/badge.svg?branch=master)](https://coveralls.io/github/mattiabasone/PagOnline?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/mattiabasone/PagOnline/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mattiabasone/PagOnline/?branch=master)

### Basic Usage
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"phpunit/phpunit": "^9.0|^10.0|^11.0",
"phpstan/phpstan": "^1.11",
"phpunit/phpunit": "^10.5|^11.0",
"phpstan/phpstan": "^1.11|^2.0",
"illuminate/config": "^9.0|^10.0|^11.0",
"orchestra/testbench": "^7.0|^8.0|^9.0",
"php-coveralls/php-coveralls": "^2.7"
Expand Down
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
level: 5
paths:
- src
- tests