A GitHub Workflow to Check the Compatibility of Your PHP Package with a Range of Dependency Versions

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • php-compatibility-demo

    Example PHP library using a GitHub Actions workflow to check whether the code is compatible with a range of PHP and dependency versions

  • Here's the file structure you should get at the end of this section (remember that you can also refer to this article's repository at any time for comparison):

  • Money

    PHP implementation of Fowler's Money pattern.

  • With that in place, let's talk about our test project for a minute. We are going to build a small library on top of Money, a popular PHP package facilitating the manipulation of monetary values and currencies.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • checkout

    Action for checking out a repo

  • Checkout (GitHub Action)

  • setup-php

    GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.

  • Setup PHP (GitHub Action)

  • PHPUnit

    The PHP Unit Testing framework.

  • Let's also instal PHPUnit as a development dependency:

  • composer-install

    :gift: A GitHub Action to streamline installation of PHP dependencies with Composer.

  • Composer Install (GitHub Action)

  • openapi-httpfoundation-testing

    Validate your HttpFoundation requests and responses against OpenAPI (3+) definitions

  • But then again, most PHP developers don't have to think about this too much. I personally started to look into compatibility testing more seriously when I created my first open-source library and, later on, when I started exploring building for the console with PHP.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • Composer

    Dependency Manager for PHP

  • A common aspect of a PHP developer's job is to deal with Composer dependencies. We use the work of others as Lego bricks to build our own projects, making the most of the beautiful thing that is the open-source movement.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts