Skip to content

Commit 353b54f

Browse files
neilimeCopilot
andcommitted
feat: add reusable PHP CI and Composer release workflows
Add Composer setup, linting, Composer test reporting, package validation, API documentation, and independent CI and release 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 353b54f

58 files changed

Lines changed: 5277 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/.checkov.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
quiet: true
3+
skip-path:
4+
- (^|/)vendor/

‎.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: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
# yamllint disable rule:line-length
38+
extra-badges: |
39+
[
40+
{
41+
"label": "GitHub Verified Creator",
42+
"url": "https://img.shields.io/badge/GitHub-Verified%20Creator-4493F8?logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJyZ2IoNjgsIDE0NywgMjQ4KSI+CiAgPHBhdGggZD0ibTkuNTg1LjUyLjkyOS42OGMuMTUzLjExMi4zMzEuMTg2LjUxOC4yMTVsMS4xMzguMTc1YTIuNjc4IDIuNjc4IDAgMCAxIDIuMjQgMi4yNGwuMTc0IDEuMTM5Yy4wMjkuMTg3LjEwMy4zNjUuMjE1LjUxOGwuNjguOTI4YTIuNjc3IDIuNjc3IDAgMCAxIDAgMy4xN2wtLjY4LjkyOGExLjE3NCAxLjE3NCAwIDAgMC0uMjE1LjUxOGwtLjE3NSAxLjEzOGEyLjY3OCAyLjY3OCAwIDAgMS0yLjI0MSAyLjI0MWwtMS4xMzguMTc1YTEuMTcgMS4xNyAwIDAgMC0uNTE4LjIxNWwtLjkyOC42OGEyLjY3NyAyLjY3NyAwIDAgMS0zLjE3IDBsLS45MjgtLjY4YTEuMTc0IDEuMTc0IDAgMCAwLS41MTgtLjIxNUwzLjgzIDE0LjQxYTIuNjc4IDIuNjc4IDAgMCAxLTIuMjQtMi4yNGwtLjE3NS0xLjEzOGExLjE3IDEuMTcgMCAwIDAtLjIxNS0uNTE4bC0uNjgtLjkyOGEyLjY3NyAyLjY3NyAwIDAgMSAwLTMuMTdsLjY4LS45MjhjLjExMi0uMTUzLjE4Ni0uMzMxLjIxNS0uNTE4bC4xNzUtMS4xNGEyLjY3OCAyLjY3OCAwIDAgMSAyLjI0LTIuMjRsMS4xMzktLjE3NWMu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IDAgMSAxLjA0Mi4wMTguNzUxLjc1MSAwIDAgMSAuMDE4IDEuMDQyWiI+PC9wYXRoPgo8L3N2Zz4K"
43+
}
44+
]
45+
secrets:
46+
github-app-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }}
47+
sync-docs:
48+
needs: release
49+
if: github.event_name != 'schedule' && github.ref_name == github.event.repository.default_branch && needs.release.outputs.artifact-id
50+
uses: hoverkraft-tech/public-docs/.github/workflows/sync-docs-dispatcher.yml@f3c9291760d927e6214e8d5f0a376af2d537c369 # 0.4.0
51+
permissions:
52+
contents: read
53+
with:
54+
artifact-id: ${{ needs.release.outputs.artifact-id }}
55+
github-app-client-id: ${{ vars.CI_BOT_APP_CLIENT_ID }}
56+
secrets:
57+
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 }}

0 commit comments

Comments
 (0)