Skip to content

Commit f597714

Browse files
authored
Merge pull request #13 from PivotPHP/feature/1.1.4
Feature/1.1.4
2 parents 675be35 + 58affd9 commit f597714

File tree

113 files changed

+13685
-3912
lines changed

Some content is hidden

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

113 files changed

+13685
-3912
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: CI/CD Pipeline
22

3-
# Optimized CI/CD - tests critical breaking changes only
4-
# Full multi-PHP version testing done locally via: ./scripts/test-all-php-versions.sh
3+
# Optimized CI/CD using consolidated scripts with automatic version detection
4+
# Multi-PHP testing available locally via: ./scripts/testing/test-all-php-versions.sh
55

66
on:
77
push:
@@ -10,9 +10,9 @@ on:
1010
branches: [ main ]
1111

1212
jobs:
13-
test:
13+
quality-check:
1414
runs-on: ubuntu-latest
15-
name: Critical CI Tests (PHP 8.1)
15+
name: Quality Validation (PHP 8.1)
1616

1717
steps:
1818
- name: Checkout code
@@ -43,53 +43,20 @@ jobs:
4343
- name: Check PHP syntax
4444
run: find src -name "*.php" -exec php -l {} \; || { echo 'PHP syntax check failed'; exit 1; }
4545

46-
- name: Run optimized CI validation
46+
- name: Run consolidated quality check
4747
run: |
48-
echo "⚡ Running optimized CI/CD validation for PHP 8.1..."
49-
echo "💡 Multi-PHP testing done locally via: ./scripts/test-all-php-versions.sh"
50-
./scripts/ci-validation.sh || { echo 'CI validation failed'; exit 1; }
51-
52-
- name: Run CI test suite
53-
run: |
54-
echo "🧪 Running CI test suite..."
55-
composer test:ci || code=$?
56-
if [ "${code:-$?}" -eq 0 ] || [ "${code:-$?}" -eq 1 ]; then
57-
echo "CI tests OK (exit code $code: success or only skipped/incomplete tests)"
58-
exit 0
59-
else
60-
echo "CI tests failed (exit code $code)"
61-
exit $code
62-
fi
48+
echo "🔍 Running consolidated quality validation..."
49+
echo "📋 Using automatic version detection from VERSION file"
50+
echo "💡 Multi-PHP testing done locally via: ./scripts/testing/test-all-php-versions.sh"
51+
scripts/quality/quality-check.sh || { echo 'Quality check failed'; exit 1; }
6352
6453
- name: Upload coverage to Codecov
6554
uses: codecov/codecov-action@v4
6655
with:
67-
file: ./coverage.xml
56+
file: ./reports/coverage.xml
6857
flags: unittests
6958
name: codecov-umbrella
70-
71-
quality:
72-
runs-on: ubuntu-latest
73-
name: Quality Gate
74-
needs: test
75-
76-
steps:
77-
- name: Checkout code
78-
uses: actions/checkout@v4
79-
80-
- name: Setup PHP
81-
uses: shivammathur/setup-php@v2
82-
with:
83-
php-version: '8.1'
84-
extensions: mbstring, xml, ctype, iconv, intl, pdo, dom, filter, gd, json, session
85-
86-
- name: Install dependencies
87-
run: composer install --prefer-dist --no-progress
88-
89-
- name: Run Quality Gate
90-
run: |
91-
echo "🏆 Running Quality Gate assessment..."
92-
./scripts/quality-gate.sh || { echo 'Quality Gate failed'; exit 1; }
59+
continue-on-error: true
9360

9461
- name: CI/CD Summary
9562
if: always()
@@ -99,11 +66,12 @@ jobs:
9966
echo " OPTIMIZED CI/CD SUMMARY"
10067
echo "========================================="
10168
echo ""
102-
echo "✅ Critical validations completed (PHP 8.1)"
69+
echo "✅ Quality validation completed (PHP 8.1)"
70+
echo "🔍 Used consolidated scripts with auto-version detection"
10371
echo ""
104-
echo "📋 Comprehensive testing:"
105-
echo " • Multi-PHP: ./scripts/test-all-php-versions.sh (PHP 8.1-8.4)"
106-
echo " • Full validation: ./scripts/validate_all.sh"
107-
echo " • Performance: ./scripts/quality-metrics.sh"
72+
echo "📋 For comprehensive testing:"
73+
echo " • Multi-PHP: ./scripts/testing/test-all-php-versions.sh (PHP 8.1-8.4)"
74+
echo " • Full validation: ./scripts/validation/validate_all.sh"
75+
echo " • Version management: ./scripts/release/version-bump.sh"
10876
echo ""
10977
echo "🚀 CI/CD optimized for speed - extensive testing done locally"

.github/workflows/pre-release.yml

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
push:
77
branches: [ main ]
88

9+
permissions:
10+
contents: read
11+
issues: write
12+
pull-requests: write
13+
914
jobs:
1015
pre-release-validation:
1116
runs-on: ubuntu-latest
@@ -20,6 +25,7 @@ jobs:
2025
with:
2126
php-version: '8.1'
2227
extensions: mbstring, xml, ctype, iconv, intl, pdo, dom, filter, gd, json, session
28+
coverage: xdebug
2329

2430
- name: Cache Composer packages
2531
uses: actions/cache@v4
@@ -38,22 +44,16 @@ jobs:
3844
- name: Check PHP syntax
3945
run: find src -name "*.php" -exec php -l {} \;
4046

41-
- name: Run PHPStan (Level 8)
42-
run: ./vendor/bin/phpstan analyse --no-progress
43-
44-
- name: Run tests with coverage
45-
run: ./vendor/bin/phpunit --coverage-text --coverage-clover coverage.xml
46-
47-
- name: Check code style (PSR-12)
48-
run: ./vendor/bin/phpcs --standard=PSR12 src/ --report=summary
49-
5047
- name: Run release preparation script
5148
run: |
52-
chmod +x scripts/prepare_release.sh
53-
echo "n\nn\nn" | ./scripts/prepare_release.sh
49+
echo "🚀 Running automated release preparation..."
50+
chmod +x scripts/release/prepare_release.sh
51+
echo "n\nn\nn" | scripts/release/prepare_release.sh
5452
5553
- name: Run project validation
56-
run: php scripts/validate_project.php
54+
run: |
55+
echo "📋 Running comprehensive project validation..."
56+
php scripts/validation/validate_project.php
5757
5858
- name: Check for security vulnerabilities
5959
run: composer audit --no-dev
@@ -62,9 +62,10 @@ jobs:
6262
- name: Upload coverage to Codecov
6363
uses: codecov/codecov-action@v4
6464
with:
65-
file: ./coverage.xml
65+
file: ./reports/coverage.xml
6666
flags: pre-release
6767
name: pre-release-coverage
68+
continue-on-error: true
6869

6970
compatibility-test:
7071
runs-on: ubuntu-latest
@@ -94,12 +95,13 @@ jobs:
9495
run: php -r "require 'vendor/autoload.php'; echo 'Autoload OK\n';"
9596

9697
- name: Basic functionality test
97-
run: php -r "
98+
run: |
99+
php -r "
98100
require 'vendor/autoload.php';
99101
use PivotPHP\Core\Core\Application;
100102
\$app = new Application();
101103
echo 'PivotPHP Core instantiated successfully on PHP ' . PHP_VERSION . '\n';
102-
"
104+
"
103105
104106
release-readiness:
105107
needs: [pre-release-validation, compatibility-test]
@@ -110,25 +112,37 @@ jobs:
110112
- name: Checkout code
111113
uses: actions/checkout@v4
112114

115+
- name: Get current version
116+
id: version
117+
run: |
118+
if [ -f "VERSION" ]; then
119+
VERSION=$(cat VERSION | tr -d '\n')
120+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
121+
else
122+
echo "VERSION=unknown" >> $GITHUB_OUTPUT
123+
fi
124+
113125
- name: Generate Release Readiness Report
114126
run: |
115-
echo "# 🚀 Release Readiness Report" >> release_report.md
127+
echo "# 🚀 Release Readiness Report - PivotPHP Core v${{ steps.version.outputs.VERSION }}" >> release_report.md
116128
echo "" >> release_report.md
117129
echo "## ✅ All Checks Passed!" >> release_report.md
118130
echo "" >> release_report.md
119-
echo "- **PHPStan**: Level 8, 0 errors" >> release_report.md
120-
echo "- **Tests**: 186 tests passing" >> release_report.md
131+
echo "- **Version**: ${{ steps.version.outputs.VERSION }}" >> release_report.md
132+
echo "- **PHPStan**: Level 9, 0 errors" >> release_report.md
133+
echo "- **Tests**: All tests passing" >> release_report.md
121134
echo "- **Code Style**: PSR-12 compliant" >> release_report.md
122-
echo "- **PHP Compatibility**: 7.4 - 8.3" >> release_report.md
135+
echo "- **PHP Compatibility**: 8.1 - 8.4" >> release_report.md
123136
echo "- **Dependencies**: All valid" >> release_report.md
137+
echo "- **Scripts**: Consolidated and optimized" >> release_report.md
124138
echo "" >> release_report.md
125139
echo "## 📦 Ready for Publication" >> release_report.md
126140
echo "" >> release_report.md
127141
echo "The project is ready to be tagged and released!" >> release_report.md
128142
echo "" >> release_report.md
129143
echo "### Next Steps:" >> release_report.md
130-
echo "1. Create a new tag: \`git tag -a v1.0.0 -m 'Release v1.0.0'\`" >> release_report.md
131-
echo "2. Push the tag: \`git push origin v1.0.0\`" >> release_report.md
144+
echo "1. Create a new tag: \`git tag -a v${{ steps.version.outputs.VERSION }} -m 'Release v${{ steps.version.outputs.VERSION }}'\`" >> release_report.md
145+
echo "2. Push the tag: \`git push origin v${{ steps.version.outputs.VERSION }}\`" >> release_report.md
132146
echo "3. The release workflow will automatically create a GitHub release" >> release_report.md
133147
echo "4. Packagist will be automatically updated" >> release_report.md
134148
@@ -147,4 +161,4 @@ jobs:
147161
owner: context.repo.owner,
148162
repo: context.repo.repo,
149163
body: report
150-
});
164+
});

.github/workflows/quality-gate.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)