Skip to content

Commit 1bbb439

Browse files
LTSCommerceclaude
andcommitted
Add GitHub Actions CI running the full php-qa-ci pipeline
The generator had no CI. This adds .github/workflows/qa.yml, which runs the complete vendor/bin/qa suite (PHPStan, PHPUnit, PHP CS Fixer, Rector, PHPArkitect, composer-require-checker, etc.) on every push to main and on pull requests — the same gate that must pass locally before any generator change ships. PHP is pinned to 8.4 (composer.json requires ^8.4). Infection and the sensitiveParameterUsage baseline are opted out in qaConfig/qaConfig.inc.bash, so no per-tool CI overrides are needed. Adapted from php-qa-ci's official github-actions template, trimmed to the single supported PHP version. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent f325eeb commit 1bbb439

1 file changed

Lines changed: 89 additions & 0 deletions

File tree

.github/workflows/qa.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# PHP QA pipeline for lts/php-openapi-generator.
2+
#
3+
# Runs the full php-qa-ci suite (vendor/bin/qa) — PHPStan, PHPUnit, PHP CS
4+
# Fixer, Rector, PHPArkitect, composer-require-checker and the rest — on every
5+
# push to main and every pull request. The same `vendor/bin/qa` that must pass
6+
# locally before any generator change ships.
7+
#
8+
# PHP is pinned to 8.4 (the sole supported version: composer.json requires
9+
# "php": "^8.4"). Mutation testing (Infection) and the sensitiveParameterUsage
10+
# baseline are opted out in qaConfig/qaConfig.inc.bash, so no per-tool env
11+
# overrides are needed here.
12+
#
13+
# Adapted from vendor/lts/php-qa-ci/templates/github-actions/php-qa-ci.yml.
14+
15+
name: PHP QA Pipeline
16+
17+
on:
18+
push:
19+
branches:
20+
- main
21+
pull_request:
22+
workflow_dispatch:
23+
24+
env:
25+
# Tell the QA tools they are running in CI.
26+
CI: true
27+
# The CI checkout is always clean; the uncommitted-changes guard does not apply.
28+
skipUncommittedChangesCheck: 1
29+
30+
jobs:
31+
qa:
32+
name: PHP QA (8.4)
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v4
38+
39+
- name: Setup PHP 8.4
40+
uses: shivammathur/setup-php@v2
41+
with:
42+
php-version: '8.4'
43+
tools: composer:v2
44+
coverage: xdebug
45+
extensions: mbstring, intl, json, zip, dom, curl, libxml, xmlwriter, xmlreader, xml, simplexml, iconv, tokenizer
46+
ini-values: |
47+
memory_limit=4G
48+
xdebug.mode=coverage
49+
50+
- name: Get composer cache directory
51+
id: composer-cache
52+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
53+
54+
- name: Cache composer dependencies
55+
uses: actions/cache@v4
56+
with:
57+
path: ${{ steps.composer-cache.outputs.dir }}
58+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
59+
restore-keys: |
60+
${{ runner.os }}-composer-
61+
62+
- name: Install dependencies
63+
run: composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader
64+
65+
- name: Verify php-qa-ci installation
66+
run: test -f vendor/bin/qa
67+
68+
- name: Cache QA tools
69+
uses: actions/cache@v4
70+
with:
71+
path: |
72+
var/qa/cache
73+
vendor/lts/php-qa-ci/vendor-phar
74+
key: ${{ runner.os }}-qa-tools-8.4-${{ hashFiles('**/phive.xml', '**/composer.lock') }}
75+
restore-keys: |
76+
${{ runner.os }}-qa-tools-8.4-
77+
${{ runner.os }}-qa-tools-
78+
79+
- name: Run QA pipeline
80+
run: vendor/bin/qa
81+
82+
- name: Upload QA logs
83+
if: always()
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: qa-logs
87+
path: var/qa/
88+
retention-days: 7
89+
if-no-files-found: ignore

0 commit comments

Comments
 (0)