Skip to content

Commit 362d0d6

Browse files
neilimeCopilot
andcommitted
feat: add reusable PHP CI and Composer release workflows
Add Composer setup, linting, PHPUnit reporting, package validation, API documentation, and separate release planning/publication workflows. Reuse shared HoverKraft quality and release actions and cover the supported paths with action and workflow integration tests. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: neilime <314088+neilime@users.noreply.github.com> Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
1 parent cfb62a2 commit 362d0d6

64 files changed

Lines changed: 5312 additions & 2 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.devcontainer/devcontainer.json‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "Alpine",
3+
"image": "mcr.microsoft.com/devcontainers/base:alpine-3.21",
4+
"features": {
5+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
6+
"ghcr.io/devcontainers/features/github-cli:1": {},
7+
"ghcr.io/devcontainers-extra/features/act:1": {}
8+
},
9+
"customizations": {
10+
"vscode": {
11+
"extensions": [
12+
"eamodio.gitlens",
13+
"github.vscode-github-actions",
14+
"github.copilot",
15+
"github.copilot-chat",
16+
"ms-vscode.makefile-tools",
17+
"esbenp.prettier-vscode"
18+
]
19+
}
20+
}
21+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Bug report
3+
about: Create a bug report
4+
title: ""
5+
labels: bug, needs triage
6+
assignees: ""
7+
---
8+
9+
<!--- Please direct any generic questions related to actions to our support community forum at https://github.community/c/code-to-cloud/github-actions/41 --->
10+
<!--- Before opening up a new bug report, please make sure to check for similar existing issues -->
11+
12+
**Description:**
13+
A clear and concise description of what the bug is.
14+
15+
**Action version:**
16+
Specify the action version
17+
18+
**Platform:**
19+
20+
- [ ] Ubuntu
21+
- [ ] macOS
22+
- [ ] Windows
23+
24+
**Runner type:**
25+
26+
- [ ] Hosted
27+
- [ ] Self-hosted
28+
29+
**Tools version:**
30+
31+
<!--- Please specify versions of node and package manager (npm, yarn, pnpm and etc)-->
32+
33+
**Repro steps:**
34+
A description with steps to reproduce the issue. If you have a public example or repository to share, please provide the link.
35+
36+
**Expected behavior:**
37+
A description of what you expected to happen.
38+
39+
**Actual behavior:**
40+
A description of what is actually happening.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ""
5+
labels: ""
6+
assignees: ""
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
12+
**Describe the solution you'd like**
13+
A clear and concise description of what you want to happen.
14+
15+
**Describe alternatives you've considered**
16+
A clear and concise description of any alternative solutions or features you've considered.
17+
18+
**Additional context**
19+
Add any other context or screenshots about the feature request here.

‎.github/dependabot.yml‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: docker
4+
open-pull-requests-limit: 20
5+
directory: /
6+
schedule:
7+
interval: weekly
8+
day: friday
9+
time: "04:00"
10+
groups:
11+
docker-dependencies:
12+
patterns:
13+
- "*"
14+
cooldown:
15+
default-days: 7
16+
- package-ecosystem: github-actions
17+
open-pull-requests-limit: 20
18+
directories:
19+
- /
20+
- /actions/**/*
21+
schedule:
22+
interval: weekly
23+
day: friday
24+
time: "04:00"
25+
groups:
26+
github-actions-dependencies:
27+
patterns:
28+
- "*"
29+
cooldown:
30+
default-days: 7
31+
- package-ecosystem: composer
32+
open-pull-requests-limit: 20
33+
versioning-strategy: increase
34+
directories:
35+
- /tests/php-project
36+
- /tests/php-project/tools
37+
schedule:
38+
interval: weekly
39+
day: friday
40+
time: "04:00"
41+
groups:
42+
php-dependencies:
43+
patterns:
44+
- "*"
45+
cooldown:
46+
default-days: 7
47+
- package-ecosystem: devcontainers
48+
open-pull-requests-limit: 20
49+
directory: /
50+
schedule:
51+
interval: weekly
52+
day: friday
53+
time: "04:00"
54+
cooldown:
55+
default-days: 7

‎.github/linters/.jscpd.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"threshold": 5,
3+
"ignore": [
4+
"**/vendor/**",
5+
"**/actions/**/README.md",
6+
"**/.github/workflows/*.md"
7+
]
8+
}

‎.github/renovate.json‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["config:recommended"],
4+
"enabledManagers": ["github-actions", "custom.regex"],
5+
"semanticCommits": "enabled",
6+
"minimumReleaseAge": "7 days",
7+
"minimumReleaseAgeBehaviour": "timestamp-optional",
8+
"pinDigests": true,
9+
"packageRules": [
10+
{
11+
"description": "Dependabot is the primary dependency updater.",
12+
"matchPackageNames": ["*"],
13+
"enabled": false
14+
},
15+
{
16+
"description": "Update docker:// action references unsupported by Dependabot.",
17+
"matchDatasources": ["docker"],
18+
"matchDepTypes": ["docker"],
19+
"enabled": true
20+
},
21+
{
22+
"description": "Keep the PHP runtime and Composer bootstrap current.",
23+
"matchManagers": ["custom.regex"],
24+
"enabled": true,
25+
"automerge": false
26+
}
27+
],
28+
"customManagers": [
29+
{
30+
"customType": "regex",
31+
"managerFilePatterns": ["/^\\.php-version$/"],
32+
"matchStrings": ["(?<currentValue>\\d+\\.\\d+(?:\\.\\d+)?)"],
33+
"datasourceTemplate": "github-tags",
34+
"depNameTemplate": "php/php-src",
35+
"versioningTemplate": "semver-coerced",
36+
"extractVersionTemplate": "^php-(?<version>\\d+\\.\\d+)\\.\\d+$"
37+
},
38+
{
39+
"customType": "regex",
40+
"managerFilePatterns": ["/^actions/setup-php/action\\.yml$/"],
41+
"matchStrings": ["tools: composer:(?<currentValue>\\d+\\.\\d+\\.\\d+)"],
42+
"datasourceTemplate": "github-releases",
43+
"depNameTemplate": "composer/composer"
44+
}
45+
]
46+
}

‎.github/workflows/__greetings.yml‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Greetings
2+
3+
on: # zizmor: ignore[dangerous-triggers] shared workflow handles PR metadata without checking out PR code
4+
issues:
5+
types: [opened]
6+
pull_request_target:
7+
branches: [main]
8+
9+
permissions: {}
10+
11+
jobs:
12+
greetings:
13+
uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@5fbb531db839a26ebcc35c4946be279f945f7633 # 1.0.0
14+
permissions:
15+
contents: read
16+
issues: write
17+
pull-requests: write

‎.github/workflows/__main-ci.yml‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Internal - Main - Continuous Integration
2+
on:
3+
push:
4+
branches:
5+
- main
6+
tags:
7+
- "*"
8+
workflow_dispatch: null
9+
schedule:
10+
- cron: 25 8 * * 1
11+
permissions: {}
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
jobs:
16+
ci:
17+
uses: $/.github/workflows/__shared-ci.yml
18+
permissions:
19+
actions: read
20+
contents: read
21+
id-token: write
22+
security-events: write
23+
statuses: write
24+
issues: write
25+
packages: read
26+
pull-requests: write
27+
release:
28+
needs: ci
29+
if: github.event_name != 'schedule'
30+
uses: hoverkraft-tech/ci-github-publish/.github/workflows/release-actions.yml@f06e0e72a76bfca57c34d08d03e5c1914275fd4c # 2.0.0
31+
permissions:
32+
contents: read
33+
with:
34+
update-all: ${{ (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch' }}
35+
github-app-client-id: ${{ vars.CI_BOT_APP_CLIENT_ID }}
36+
merge-method: squash
37+
secrets:
38+
github-app-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }}
39+
sync-docs:
40+
needs: release
41+
if: github.event_name != 'schedule' && github.ref_name == github.event.repository.default_branch && needs.release.outputs.artifact-id
42+
uses: hoverkraft-tech/public-docs/.github/workflows/sync-docs-dispatcher.yml@f3c9291760d927e6214e8d5f0a376af2d537c369 # 0.4.0
43+
permissions:
44+
contents: read
45+
with:
46+
artifact-id: ${{ needs.release.outputs.artifact-id }}
47+
github-app-client-id: ${{ vars.CI_BOT_APP_CLIENT_ID }}
48+
secrets:
49+
github-app-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Need fix to Issue
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
inputs:
9+
#checkov:skip=CKV_GHA_7: required
10+
manual-commit-ref:
11+
description: "The SHA of the commit to get the diff for"
12+
required: true
13+
manual-base-ref:
14+
description: "By default, the commit entered above is compared to the one directly before it; to go back further, enter an earlier SHA here"
15+
required: false
16+
17+
permissions: {}
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
main:
25+
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@5fbb531db839a26ebcc35c4946be279f945f7633 # 1.0.0
26+
permissions:
27+
contents: read
28+
issues: write
29+
with:
30+
manual-commit-ref: ${{ inputs.manual-commit-ref }}
31+
manual-base-ref: ${{ inputs.manual-base-ref }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Internal - Pull request - Continuous Integration
2+
on:
3+
merge_group: null
4+
pull_request:
5+
branches:
6+
- main
7+
permissions: {}
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
jobs:
12+
ci:
13+
uses: $/.github/workflows/__shared-ci.yml
14+
permissions:
15+
actions: read
16+
contents: read
17+
id-token: write
18+
security-events: write
19+
statuses: write
20+
issues: write
21+
packages: read
22+
pull-requests: write

0 commit comments

Comments
 (0)