Skip to content

Add CI checks with GitHub Actions#45

Merged
echarrod merged 5 commits intomainfrom
copilot/fix-42
Aug 13, 2025
Merged

Add CI checks with GitHub Actions#45
echarrod merged 5 commits intomainfrom
copilot/fix-42

Conversation

Copy link
Contributor

Copilot AI commented Jul 31, 2025

This PR adds comprehensive CI checks to automatically run the complete test suite on every pull request and commit to the main branch.

Changes Made

CI Configuration

  • Added .github/workflows/ci.yml with GitHub Actions workflow
  • Configured to run on pushes to main/master branches and all pull requests
  • Matrix testing across multiple PHP versions: 7.3, 7.4, 8.0, 8.1, 8.2, 8.3
  • Includes composer validation, dependency caching, and full test suite execution

PHPUnit Compatibility

  • Updated PHPUnit from version 7.1.4 to ^9.0 to support modern PHP versions (including PHP 8.3)
  • Migrated PHPUnit configuration to modern schema to remove deprecation warnings
  • All 14 tests continue to pass with 18 assertions

Project Cleanup

  • Removed version field from composer.json (not needed for Packagist libraries)
  • Added .phpunit.result.cache to .gitignore to exclude build artifacts

CI Features

  • Automatic validation: Validates composer.json and composer.lock integrity
  • Dependency caching: Caches Composer packages for faster builds
  • Cross-version testing: Ensures compatibility across supported PHP versions
  • Modern tooling: Uses latest GitHub Actions (checkout@v4, setup-php@v2, cache@v3)

The workflow will now automatically catch regressions and ensure code quality on every change.

Fixes #42.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/cweiske/jsonmapper/zipball/0d4d1b48d682a93b6bfedf60b88c7750e9cb0b06
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/jhJdal /usr/bin/composer install (http block)
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/9614ac4d8061dc257ecc64cba1b140873dce8ad3
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/jhJdal /usr/bin/composer install (http block)
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/HBeEor /usr/bin/composer install --no-interaction (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Summary by CodeRabbit

  • Chores
    • Added a CI workflow to run PHP tests across multiple PHP versions on push and PRs.
    • Ignored PHPUnit result cache files to keep the repository clean.
    • Updated PHPUnit-related dev dependency constraints to support PHPUnit 9.x.
    • Upgraded the test configuration for compatibility with newer PHPUnit and improved coverage settings.

Co-authored-by: dasco144 <10575019+dasco144@users.noreply.github.com>
Copilot AI changed the title [WIP] Add CI Checks Add CI checks with GitHub Actions Jul 31, 2025
Copilot AI requested a review from dasco144 July 31, 2025 13:44
@dasco144 dasco144 requested a review from echarrod July 31, 2025 13:49
@dasco144 dasco144 marked this pull request as ready for review July 31, 2025 13:56
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 31, 2025

Walkthrough

Adds a new GitHub Actions workflow (.github/workflows/ci.yml) named "CI" that runs on push and pull_request events targeting main and executes a test job on ubuntu-latest across PHP versions 8.2, 8.3 and 8.4. Steps: checkout, setup PHP, composer validate, cache vendor, composer install, and run vendor/bin/phpunit. Updates composer.json (removed version field, bumped phpunit require-dev to ^9.0), updates phpunit.xml schema and coverage include settings, and adds .phpunit.result.cache to .gitignore.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Assessment against linked issues

Objective Addressed Explanation
Add CI checks to run tests on each MR and commits to main, running full test suite (#42)

Poem

A rabbit sips a dewy cup,
Tests now run with every push and PR,
Across PHP hops, green and spry,
Caches tucked and suites run by,
🐇🌿

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/fix-42

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@dasco144
Copy link
Contributor

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 31, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
.github/workflows/ci.yml (2)

40-41: Run Composer non-interactively for CI stability

Add the --no-interaction flag to avoid any accidental prompts blocking the job.

-      run: composer install --prefer-dist --no-progress
+      run: composer install --prefer-dist --no-progress --no-interaction

44-44: Missing newline at end of file

YAML linters complain when the final newline is absent.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c21693f and 3e258e4.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml (1 hunks)
  • .gitignore (1 hunks)
  • composer.json (1 hunks)
  • phpunit.xml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/ci.yml

33-33: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 YAMLlint (1.37.1)
.github/workflows/ci.yml

[error] 44-44: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (3)
.gitignore (1)

5-5: Add-on ignored correctly

Ignoring .phpunit.result.cache prevents build artefacts from polluting the repo. Looks good.

composer.json (1)

24-25: Declare the minimum supported PHP version

PHPUnit 9 requires PHP ≥ 7.3, so please add a PHP platform constraint to your composer.json to avoid confusing resolution errors:

 "require": {
+  "php": ">=7.3",
   "guzzlehttp/guzzle": "^6.3.3",
   "netresearch/jsonmapper": "^1.4"
 },

• File: composer.json, under the "require" section
• Lines: around 24–25

Please confirm that this new constraint aligns with all officially supported PHP runtimes for the SDK.

phpunit.xml (1)

2-7: PHPUnit config upgrade looks sound

The schema bump to 9.3 and the new <coverage> block are correct for PHPUnit 9. No issues spotted.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@echarrod echarrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after suggested changes

dasco144 and others added 2 commits August 12, 2025 15:45
Co-authored-by: Ed Harrod <echarrod@users.noreply.github.com>
Co-authored-by: Ed Harrod <echarrod@users.noreply.github.com>
@echarrod
Copy link
Contributor

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 12, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

coderabbitai[bot]
coderabbitai bot previously requested changes Aug 12, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
.github/workflows/ci.yml (1)

33-33: Cache action is on @v4 — good catch.

This addresses the prior actionlint warning about @V3 being too old.

🧹 Nitpick comments (6)
.github/workflows/ci.yml (6)

22-27: Enable Composer v2 + cache in setup-php for speed and stability.

Leverage setup-php’s first-class Composer support instead of a manual vendor cache.

Suggested setup (replace current with block below):

with:
  php-version: ${{ matrix.php-version }}
  coverage: none
  tools: composer:v2
  cache: composer

14-17: Run the full matrix even if one job fails.

Add fail-fast: false so failures on one PHP version don’t mask others.

     strategy:
+      fail-fast: false
       matrix:
         php-version: ['8.2', '8.3', '8.4']

3-9: Add concurrency to cancel superseded runs on pushes to the same ref.

This saves CI minutes and speeds feedback on active PRs.

   pull_request:
     branches: [ main ]
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true

9-13: Harden workflow permissions (principle of least privilege).

Explicitly declare minimal permissions at the workflow level.

 on:
   push:
     branches: [ main ]
   pull_request:
     branches: [ main ]
 
+permissions:
+  contents: read

40-41: Use non-interactive Composer install.

Prevents any prompts from stalling the job and is standard for CI.

-      run: composer install --prefer-dist --no-progress
+      run: composer install --prefer-dist --no-progress --no-interaction

44-44: Add a trailing newline at EOF.

Fixes the YAML lint error and aligns with POSIX tooling expectations.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3e258e4 and b0f932d.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/ci.yml

[error] 44-44: no new line character at the end of file

(new-line-at-end-of-file)

@echarrod echarrod merged commit b2f1150 into main Aug 13, 2025
4 checks passed
@dasco144 dasco144 deleted the copilot/fix-42 branch August 13, 2025 15:07
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.

Add CI Checks

3 participants