Skip to content

Commit 64e31ca

Browse files
authored
update workflow (#11)
* update workflow * update workflow * update scrutinizer image * update scrutinizer image * update phpunit * remove scrutinizer config file update php 8.4 workflow * add another workflow
1 parent 76dc036 commit 64e31ca

File tree

5 files changed

+54
-36
lines changed

5 files changed

+54
-36
lines changed

.github/workflows/php.yml

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,38 @@
11
name: Test
22

3-
on: [push]
3+
on:
4+
pull_request:
5+
branches: ["master"]
6+
paths-ignore:
7+
- "README.md"
8+
- ".gitignore"
9+
- "LICENSE.md"
10+
push:
11+
branches: ["master"]
12+
413
jobs:
514
test:
6-
7-
name: Test PHP ${{ matrix.php-versions }}
15+
name: Test PHP ${{ matrix.php.version }} ${{ matrix.php.composer }}
816
runs-on: ubuntu-latest
917
strategy:
1018
matrix:
11-
php-versions: ['8.0', '8.1', '8.2', '8.3']
19+
php:
20+
- version: '8.1'
21+
composer: --prefer-lowest
22+
- version: '8.2'
23+
composer: --prefer-lowest
24+
- version: '8.3'
25+
composer: --prefer-lowest
26+
#- version: '8.4'
27+
# composer: --prefer-lowest
28+
- version: '8.1'
29+
composer: --prefer-stable
30+
- version: '8.2'
31+
composer: --prefer-stable
32+
- version: '8.3'
33+
composer: --prefer-stable
34+
- version: '8.4'
35+
composer: --prefer-stable
1236

1337
steps:
1438
- uses: actions/checkout@v4
@@ -21,7 +45,7 @@ jobs:
2145
- name: Setup PHP
2246
uses: shivammathur/setup-php@v2
2347
with:
24-
php-version: ${{ matrix.php-versions }}
48+
php-version: ${{ matrix.php.version }}
2549
extensions: curl, mbstring, intl, libxml, simplexml
2650
coverage: xdebug
2751

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

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

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

70+
- name: Static Analysis
71+
if: matrix.php.version == '8.3' && matrix.php.composer == '--prefer-stable'
72+
run: composer analyse
73+
4674
- name: "[Coveralls] Extract branch name"
47-
if: matrix.php-versions == '8.3'
75+
if: matrix.php.version == '8.3' && matrix.php.composer == '--prefer-stable'
4876
shell: bash
49-
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
77+
run: |
78+
if [ -n "${GITHUB_HEAD_REF}" ]; then
79+
echo "Branch from PR: ${GITHUB_HEAD_REF}"
80+
echo "branch=${GITHUB_HEAD_REF}" >> $GITHUB_OUTPUT
81+
else
82+
branch_name="${GITHUB_REF#refs/heads/}"
83+
echo "Branch from push: ${branch_name}"
84+
echo "branch=${branch_name}" >> $GITHUB_OUTPUT
85+
fi
5086
id: extract_branch
5187

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

5793
- name: "[Coveralls] Send report"
58-
if: matrix.php-versions == '8.3'
94+
if: matrix.php.version == '8.3' && matrix.php.composer == '--prefer-stable'
5995
run: ./vendor/bin/php-coveralls -v -x clover.xml -o coveralls-upload.json
6096
env:
6197
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.scrutinizer.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ With this package I'm trying to improve the crappy IGFS CG PHP Library provided
88
[![Latest Stable Version](https://poser.pugx.org/mattiabasone/pagonline/v/stable)](https://packagist.org/packages/mattiabasone/pagonline)
99
[![Total Downloads](https://poser.pugx.org/mattiabasone/pagonline/downloads)](https://packagist.org/packages/mattiabasone/pagonline)
1010
[![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)
11-
[![Coverage Status](https://scrutinizer-ci.com/g/mattiabasone/PagOnline/badges/coverage.png?b=master)](https://coveralls.io/github/mattiabasone/PagOnline)
11+
[![Coverage Status](https://coveralls.io/repos/github/mattiabasone/PagOnline/badge.svg?branch=master)](https://coveralls.io/github/mattiabasone/PagOnline?branch=master)
1212
[![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)
1313

1414
### Basic Usage

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
},
3030
"require-dev": {
3131
"friendsofphp/php-cs-fixer": "^3.0",
32-
"phpunit/phpunit": "^9.0|^10.0|^11.0",
33-
"phpstan/phpstan": "^1.11",
32+
"phpunit/phpunit": "^10.5|^11.0",
33+
"phpstan/phpstan": "^1.11|^2.0",
3434
"illuminate/config": "^9.0|^10.0|^11.0",
3535
"orchestra/testbench": "^7.0|^8.0|^9.0",
3636
"php-coveralls/php-coveralls": "^2.7"

phpstan.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
level: 5
3+
paths:
4+
- src
5+
- tests

0 commit comments

Comments
 (0)