Skip to content
This repository was archived by the owner on Jan 6, 2026. It is now read-only.
Open
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: 56 additions & 0 deletions .github/workflows/php-reusable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
on:
workflow_call:
inputs:
php_version:
description: 'PHP version to use'
type: string
required: true
secrets:
COMPOSER_TOKEN:
required: true

permissions:
contents: read

jobs:
php-quality-checks:
name: 'PHP ${{ inputs.php_version }} Quality & Testing'
timeout-minutes: 60
runs-on: ubuntu-latest

steps:
# Setup Phase
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup PHP environment and dependencies
uses: ./.github/workflows/set-up-php-tests
with:
php_version: ${{ inputs.php_version }}
COMPOSER_TOKEN: ${{ secrets.COMPOSER_TOKEN }}


# Testing Phase
- name: Run tests
run: ./vendor/bin/phpunit tests/

# Code Quality Checks
- name: Run codesniffer checks
run: |
composer sniffer:php81
composer sniffer:php84
composer sniffer:psr12

# Code Quality Checks
- name: Get files changed in PR for Rector
id: changed-files
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5

- name: Run Rector checks
if: ${{ '!cancelled()' && steps.changed-files.outputs.all_changed_files }}
run: composer rector --ansi ${{ steps.changed-files.outputs.all_changed_files }}

- name: Run PHPStan analysis
run: composer stan
25 changes: 25 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: PHP

on:
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
php-checks:
name: 'PHP ${{ matrix.php_version }}'
uses: ./.github/workflows/php-reusable.yml
strategy:
matrix:
include:
- php_version: '8.1'
# - php_version: '8.4'
with:
php_version: ${{ matrix.php_version }}
secrets:
COMPOSER_TOKEN: ${{ secrets.ACTIONS_COMPOSER_TOKEN }}
62 changes: 62 additions & 0 deletions .github/workflows/set-up-php-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Set Up PHP Tests
description: Sets up PHP and dependencies for testing

inputs:
php_version:
description: PHP version to use
required: true
COMPOSER_TOKEN:
description: The GitHub Actions token for Composer to use
required: true

runs:
using: 'composite'

steps:
- name: Configure time zones
shell: bash
run: sudo timedatectl set-timezone Europe/London

- name: Set up PHP
id: setup-php
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
with:
php-version: ${{ inputs.php_version }}
ini-values: error_reporting=E_ALL, date.timezone=Europe/London, max_execution_time=120
tools: composer
extensions: zip, mbstring, pdo, pdo_mysql, bcmath, ctype, fileinfo, json, tokenizer, xml
coverage: none
env:
GITHUB_TOKEN: ${{ inputs.COMPOSER_TOKEN }}

- name: Set env
shell: bash
run: |
echo "PATH=~/.config/composer/vendor/bin:$PATH" >> $GITHUB_ENV
echo "ENVIRONMENT=github" >> $GITHUB_ENV

- name: Configure Composer
shell: bash
env:
COMPOSER_TOKEN: ${{ inputs.COMPOSER_TOKEN }}
run: composer config --global github-oauth.github.com "$COMPOSER_TOKEN"

- name: Get composer cache directory
shell: bash
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ inputs.php_version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-php-${{ inputs.php_version }}-

- name: Install Phing
shell: bash
run: composer global require phing/phing:^2.17

- name: Install PHP dependencies
shell: bash
run: composer install --prefer-dist --no-progress --no-interaction
2 changes: 2 additions & 0 deletions .phpcs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/
tests/
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

43 changes: 28 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "imjoehaines/flowdception",
"name": "may-den/flowdception",
"description": "A Codeception Extension for Flowder",
"keywords": [
"testing",
Expand All @@ -8,16 +8,8 @@
"fixtures",
"fixture-loading"
],
"homepage": "https://github.com/imjoehaines/flowdception",
"homepage": "https://github.com/may-den/flowdception/",
"license": "Unlicense",
"authors": [
{
"name": "Joe Haines",
"email": "hello@joehaines.co.uk",
"homepage": "https://www.joehaines.co.uk",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"Imjoehaines\\Flowder\\Codeception\\": "src/"
Expand All @@ -28,18 +20,39 @@
"Imjoehaines\\Flowder\\Codeception\\Test\\": "tests/"
}
},
"require-dev": {
"phpunit/phpunit": "^9.5.1"
},
"require": {
"php": "^8",
"php": "^8.1",
"imjoehaines/flowder": "^2.1",
"codeception/codeception": "^5"
},
"require-dev": {
"phpunit/phpunit": "^9.5.1",
"dealerdirect/phpcodesniffer-composer-installer": "^1",
"phpcompatibility/php-compatibility": "dev-develop",
"phpstan/phpstan": "^2.1",
"rector/rector": "^2.1",
"squizlabs/php_codesniffer": "^3.13"
},
"scripts": {
"sniffer:php81": "phpcs -p . --ignore=vendor/* --standard=vendor/phpcompatibility/php-compatibility/PHPCompatibility --extensions=php --report-full=compatibility.txt --runtime-set testVersion 8.1",
"sniffer:php84": "phpcs -p . --ignore=vendor/* --standard=vendor/phpcompatibility/php-compatibility/PHPCompatibility --extensions=php --report-full=compatibility.txt --runtime-set testVersion 8.4",
"sniffer:psr12": "phpcs -p . --ignore=vendor/* --standard=PSR12 --extensions=php --report-full=PSR12Report.txt -v",
"sniffer:fix-psr12": "./vendor/bin/phpcbf --file-list=.phpcs --standard=PSR12",
"rector": "./vendor/bin/rector process --dry-run",
"rector:fix": "./vendor/bin/rector process",
"stan": "./vendor/bin/phpstan analyse --memory-limit=2G --configuration=phpstan.neon",
"stan:baseline": "./vendor/bin/phpstan analyse --memory-limit=2G --configuration=phpstan.neon --generate-baseline",
"test": "./vendor/bin/phpunit tests/"
},
"repositories": [
{
"type": "vcs",
"url": "git@github.com:may-den/flowder.git"
}
]
],
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
Loading
Loading