1.9 KiB
1.9 KiB
Package Workflows
These workflow templates are for library packages (host-uk/core, host-uk/core-api, etc.), not application projects.
README Badges
Add these badges to your package README (replace {package} with your package name):
[](https://github.com/host-uk/{package}/actions/workflows/ci.yml)
[](https://codecov.io/gh/host-uk/{package})
[](https://packagist.org/packages/host-uk/{package})
[](https://packagist.org/packages/host-uk/{package})
[](LICENSE)
Usage
Copy the relevant workflows to your library's .github/workflows/ directory:
# In your library repo
mkdir -p .github/workflows
cp path/to/core-template/.github/package-workflows/ci.yml .github/workflows/
cp path/to/core-template/.github/package-workflows/release.yml .github/workflows/
Workflows
ci.yml
- Runs on push/PR to main
- Tests against PHP 8.2, 8.3, 8.4
- Tests against Laravel 11 and 12
- Runs Pint linting
- Runs Pest tests
release.yml
- Triggers on version tags (v*)
- Generates changelog using git-cliff
- Creates GitHub release
Requirements
For these workflows to work, your package needs:
- cliff.toml - Copy from core-template root
- Pest configured -
composer require pestphp/pest --dev - Pint configured -
composer require laravel/pint --dev - CODECOV_TOKEN - Add to repo secrets for coverage uploads
- FUNDING.yml - Copy
.github/FUNDING.ymlfor sponsor button
Recommended composer.json scripts
{
"scripts": {
"lint": "pint",
"test": "pest",
"test:coverage": "pest --coverage"
}
}