Projects using larastrict/conventions or strictphp/conventions already match the expected commands and tooling used by these workflows.
Use .github/workflows/php-check.yml to run code quality checks.
What it does:
- Validates
composer.jsonwithcomposer validate - Installs dependencies with
composer install - Runs ECS with
composer lint:check - Runs Rector with
composer lint:upgrade:check - Runs PHPStan with
composer analyse - Runs static analysis on both lowest and highest dependency versions
Required project scripts and tools:
composer analysecomposer lint:checkcomposer lint:upgrade:check
Projects using larastrict/conventions or strictphp/conventions already match these required commands and tools.
Example:
name: Check
on:
pull_request:
push:
branches:
- "*"
- "!gh-pages"
jobs:
check:
uses: wrk-flow/reusable-workflows/.github/workflows/php-check.yml@main
with:
phpVersion: "8.3"
workingDirectory: "."
secrets: inheritAvailable inputs:
phpVersion- PHP version to use, default8.1workingDirectory- project directory, default.composerRequire- extra packages to require before installcomposerRequireDev- extra dev packages to require before install
Use .github/workflows/php-tests.yml to run PHPUnit and optionally publish a coverage badge.
What it does:
- Runs PHPUnit with coverage output
- Tests both lowest and highest dependency versions
- Extracts line coverage from the PHPUnit report
- Optionally publishes coverage to a Gist as
coverage.json
Required project setup:
vendor/bin/phpunitmust be available- Xdebug coverage must work in your test suite
Example:
name: Tests
on:
pull_request:
push:
branches:
- main
jobs:
tests:
strategy:
matrix:
phpVersion: ["8.3", "8.4"]
uses: wrk-flow/reusable-workflows/.github/workflows/php-tests.yml@main
with:
phpVersion: ${{ matrix.phpVersion }}
workingDirectory: "."
gistID: "your-gist-id"
gistOnPhpVersion: "8.3"
secrets:
GIST_SECRET: ${{ secrets.GIST_SECRET }}Available inputs:
phpVersion- PHP version to use, default8.1workingDirectory- project directory, default.composerRequire- extra packages to require before installcomposerRequireDev- extra dev packages to require before installcomposerRemove- packages to remove after installdirsRemove- directories to remove before running testsgistID- Gist ID used for the coverage badgegistOnPhpVersion- only publish the badge for this PHP version, default8.1badgeOnBranch- only publish on this branch, defaultmainbadgeOnPullRequest- also publish on pull requests, defaultfalse
Coverage badge notes:
- Badge publishing only runs when
gistIDis set andGIST_SECRETis passed to the reusable workflow. - Create a Gist first and use
coverage.jsonas the filename. - If you use an organization secret, pass it explicitly:
secrets:
GIST_SECRET: ${{ secrets.GIST_SECRET }}secrets: inheritcan be used for general secret forwarding, but forphp-tests.ymlit is safer to documentGIST_SECRETexplicitly because the reusable workflow declares that secret by name.
- Create a file
.github/workflows/deploy-docs.yml - Create
docsfolder and setuppackage.jsonwith this commandnpm run generate- Use NuxtJS content package
- Deploy will build the site and deploy
docs/disttogh-pages(which is cleaned from original source code).- Deploy on
mainbranch - Deploy on
v**tags to ensure that NuxtJS content docs theme updatesReleasespage
- Deploy on
name: Documentation
on:
push:
branches:
- main
tags:
- v**
jobs:
run:
uses: wrk-flow/reusable-workflows/.github/workflows/deploy-docs.yml@main
secrets: inherit