Skip to content

Feat: Workflow integration CI/CD pipeline - #1692

Merged
analisopendesa merged 3 commits into
rilis-devfrom
fitur/workflow_integration_without_lint
Jul 29, 2026
Merged

Feat: Workflow integration CI/CD pipeline#1692
analisopendesa merged 3 commits into
rilis-devfrom
fitur/workflow_integration_without_lint

Conversation

@pandigresik

Copy link
Copy Markdown
Contributor

Pull Request: Feat: Workflow integration CI/CD pipeline

Description

Add a comprehensive CI/CD integration pipeline with GitHub Actions for automated testing, coverage gating, and code quality enforcement. This includes unit tests, integration tests, contract tests, e2e tests, a coverage threshold gate, flaky test detection, and Laravel Pint configuration. The lint job is temporarily disabled to unblock the pipeline while style issues are addressed separately.

Changes made:

  1. CI/CD Pipeline: New .github/workflows/integration-regression.yml — GitHub Actions workflow with jobs for lint (disabled), unit tests (with coverage), integration tests (with coverage), contract tests, e2e tests (gated), and coverage gate validation
  2. Coverage Gate Script: New bin/check-coverage.php — CLI tool to enforce minimum coverage threshold and maximum allowed coverage drop from previous runs
  3. Flaky Test Detection: New bin/detect-flaky-tests.php — Script to analyze JUnit XML reports for flaky, slow, or zero-duration tests
  4. Code Style Config: New pint.json — Laravel Pint configuration for enforcing PHP code style standards
  5. PHPUnit Config: Modified phpunit.xml — Added Contract test suite and trailing whitespace cleanup
  6. Test Cleanup: Modified tests/Feature/Auth/AuthorizationTest.php — Removed obsolete kontributor-artikel role test
  7. Test Setup Improvement: Modified tests/TestCase.php — Improved Profil seeding to handle existing records gracefully

Reason for change:

  • Automated quality gates: Ensure every PR meets minimum coverage and style standards before merge
  • Regression prevention: Catch regressions early with automated contract and e2e tests
  • Developer productivity: Reduce manual testing overhead by automating the verification pipeline
  • Test stability: Remove flaky/obsolete tests and add detection tooling for unstable tests

Impact of change:

  • ✅ All future PRs will be automatically tested for regressions
  • ✅ Coverage thresholds prevent code quality degradation
  • ✅ Contract tests ensure API compatibility
  • ✅ E2E tests verify critical user flows
  • ✅ Flaky test detection helps maintain test suite reliability
  • ✅ Standardized code style via Pint configuration

Related Issue

#1676

Steps to Reproduce

Before (no CI/CD):

  1. Push changes to a branch
  2. Manually run tests locally
  3. No automated quality gates
  4. ❌ Easy to miss regressions or coverage drops

After (CI/CD pipeline):

  1. Create PR against rilis-dev
  2. GitHub Actions automatically triggers the pipeline
  3. Unit, integration, contract, and e2e tests run
  4. Coverage gate validates thresholds
  5. ✅ Pipeline blocks merge if any stage fails

Checklist

  • I have complied with script writing rules
  • I have followed pull request review process
  • I have created unit test/integration test to verify the fix
  • Manual testing has been done in development environment
  • No console errors or warnings
  • Code has been reviewed by at least 1 person

Technical Details

Technical Explanation

The CI/CD pipeline is organized as a DAG with the following stages:

lint ──────────────────────────────────────┐
unit (coverage) ───────────────────────────┤
                                           ├──→ coverage-gate
generate-openapi ──→ contract ─────────────┤
                                           ├──→ e2e (gated)
integration (coverage) ────────────────────┘
  • Unit Tests: Fast MySQL-backed tests running with pcov coverage
  • Integration Tests: Runs against MySQL service container with coverage
  • Contract Tests: Validates API contract against generated OpenAPI spec
  • Coverage Gate: Custom PHP script (bin/check-coverage.php) validates min threshold (30%) and max allowable drop (2%)
  • Flaky Detection: bin/detect-flaky-tests.php analyzes JUnit XML for unstable tests
  • E2E: Gated stage running only if all prior stages pass

Configuration changes

  • phpunit.xml — Added Contract test suite
  • pint.json — New Laravel Pint configuration for code style

Dependencies added

No new dependencies

Testing

Manual Testing

  • Pipeline runs successfully on push to branch
  • Coverage gate script works with valid/invalid thresholds
  • Flaky detection script parses JUnit XML correctly
  • Regression Testing — test existing features are not broken

Automated Testing

  • Unit Test — Existing test suite passes
  • Integration Test — Existing integration tests pass
  • Contract Test — Contract validation passes

Breaking Changes

None

Migration Guide

Not required

References


Additional notes: The lint job is currently commented out. It should be re-enabled in a follow-up PR once existing style issues are resolved across the codebase.

@pandigresik
pandigresik requested a review from vickyrolanda July 29, 2026 01:43
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI PR Review sedang antri di server...

Proses review akan segera dimulai di background — hasil akan muncul sebagai komentar setelah selesai.
Powered by CrewAI · PR #1692

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants