Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/auto-resolve-conflicts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ permissions:

jobs:
auto-resolve-conflicts:
uses: php-fast-forward/dev-tools/.github/workflows/auto-resolve-conflicts.yml@main
uses: php-fast-forward/.github/.github/workflows/auto-resolve-conflicts.yml@task/2-extract-shared-workflows
with:
base-ref: ${{ inputs.base-ref || github.event.pull_request.base.ref || github.event.repository.default_branch || 'main' }}
pull-request-number: ${{ inputs.pull-request-number || github.event.pull_request.number || '' }}
Expand Down
49 changes: 13 additions & 36 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,23 @@ on:
required: false
type: string
default: CHANGELOG.md
base-ref:
description: Base branch used for changelog comparison.
version:
description: Optional version to promote during manual release preparation.
required: false
type: string
default: main
default: ''

permissions:
contents: read
actions: write
contents: write
pull-requests: write
repository-projects: write

jobs:
changelog:
name: Changelog
runs-on: ubuntu-latest
env:
BASE_REF: ${{ github.event.pull_request.base.ref || inputs.base-ref || github.event.repository.default_branch || 'main' }}
CHANGELOG_FILE: ${{ inputs.changelog-file || 'CHANGELOG.md' }}
COMPOSER_ROOT_VERSION: ${{ github.event_name == 'pull_request' && format('dev-{0}', github.event.pull_request.head.ref) || 'dev-main' }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
coverage: none

- name: Install global dev-tools
run: |
composer global config --no-plugins allow-plugins.ergebnis/composer-normalize true
composer global config --no-plugins allow-plugins.fast-forward/dev-tools true
composer global config --no-plugins allow-plugins.phpdocumentor/shim true
composer global config --no-plugins allow-plugins.phpro/grumphp-shim true
composer global config --no-plugins allow-plugins.pyrech/composer-changelogs true
composer global require fast-forward/dev-tools:dev-main --with-all-dependencies --no-progress --no-interaction
composer global config --no-plugins allow-plugins.fast-forward/dev-tools false

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction

- name: Check changelog
run: composer dev-tools changelog:check -- --file="${CHANGELOG_FILE}" --against="origin/${BASE_REF}"
uses: php-fast-forward/.github/.github/workflows/changelog.yml@task/2-extract-shared-workflows
with:
changelog-file: ${{ inputs.changelog-file || 'CHANGELOG.md' }}
dev-tools-version: ^1.0
version: ${{ inputs.version || '' }}
secrets: inherit
26 changes: 19 additions & 7 deletions .github/workflows/reports.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
name: "Fast Forward Reports"

on:
pull_request:
types:
- opened
- synchronize
- reopened
- closed
workflow_dispatch:
inputs:
cleanup-previews:
description: Remove stale pull request previews without publishing production reports.
required: false
type: boolean
default: false

permissions:
contents: read
contents: write
pull-requests: write

jobs:
reports:
name: Reports
runs-on: ubuntu-latest
steps:
- name: Reports deferred
run: |
echo "Report publication is deferred until fast-forward/dev-tools can run its bundled toolchain globally."
uses: php-fast-forward/.github/.github/workflows/reports.yml@task/2-extract-shared-workflows
with:
cleanup-previews: ${{ github.event_name == 'workflow_dispatch' && inputs.cleanup-previews || false }}
dev-tools-version: ^1.0
secrets: inherit
62 changes: 4 additions & 58 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,61 +21,7 @@ permissions:

jobs:
tests:
name: Run Tests (${{ matrix.php-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
- "8.3"
- "8.4"
- "8.5"
env:
COMPOSER_ROOT_VERSION: ${{ github.event_name == 'pull_request' && format('dev-{0}', github.event.pull_request.head.ref) || 'dev-main' }}
steps:
- uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction

- name: Validate composer metadata
run: composer validate --strict

- name: Validate packaged payload
run: |
test -d .agents/agents
test -d .agents/skills
test -f .agents/agents/fast-forward-issue-implementer.md
test -f .agents/skills/fast-forward-github-pull-request/SKILL.md
php -r '$composer = json_decode(file_get_contents("composer.json"), true, flags: JSON_THROW_ON_ERROR); if (($composer["type"] ?? null) !== "fast-forward-resource-bundle") { exit(1); } if (($composer["require"]["fast-forward/composer-installers"] ?? null) !== "^0.1") { exit(1); } if (($composer["extra"]["fast-forward-bundle"]["payload-path"] ?? null) !== ".agents") { exit(1); }'

- name: Publish required test status
if: ${{ always() && inputs.publish-required-statuses }}
env:
GH_TOKEN: ${{ github.token }}
TARGET_SHA: ${{ github.sha }}
TARGET_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
TEST_CONTEXT: Run Tests (${{ matrix.php-version }})
TEST_RESULT: ${{ job.status }}
run: |
if [ "${TEST_RESULT}" = "success" ]; then
state="success"
description="Workflow-dispatched package validation job passed."
else
state="failure"
description="Workflow-dispatched package validation job result: ${TEST_RESULT}."
fi

gh api \
--method POST \
"repos/${GITHUB_REPOSITORY}/statuses/${TARGET_SHA}" \
-f state="${state}" \
-f context="${TEST_CONTEXT}" \
-f description="${description}" \
-f target_url="${TARGET_URL}"
uses: php-fast-forward/.github/.github/workflows/tests.yml@task/2-extract-shared-workflows
with:
dev-tools-version: ^1.0
publish-required-statuses: ${{ github.event_name == 'workflow_dispatch' && inputs.publish-required-statuses || false }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Prefix packaged Fast Forward agent files and skill directories with `fast-forward-` to reduce collisions with consumer-owned agents and skills.
- Smoke-test shared workflow wrappers against the `.github` extraction branch.
Loading