Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to prepare a PR to add the GHA CI workflow to Laminas/Mezzio/Laminas API Tools repos

PRs should do the following:

  • Remove the file (we will be doing changelogs in the milestone descriptions, and those get propagated to tags and release notes)

  • Add the workflow file:

    mkdir -p .github/workflows ; cd  .github/workflows ; wget
  • Check to see if there are any differences between what the Travis config and the GHA workflow do - don't worry about code coverage - but check for things like: extensions required, any pre-script tasks, etc. (Most of the time, there aren't any). If you see any, either: (1) add a .laminas-ci.json file with required configuration (e.g., adding extensions, adding php.ini settings; see for details), or (2) add information to the GHA workflow file (e.g., adding a service such as MySQL, Redis, etc.; see the laminas-db or laminas-cache adapter packages for examples).

  • Remove the .travis.yml file.

  • Remove the entry for composer.lock from the .gitignore file.

  • In the .gitattributes file:

    • Remove the entry for .travis.yml
    • Add an entry for .laminas-ci.json if you created one
    • Add an entry for .github if one does not exist
  • Using PHP 7.4, run composer update

  • Update the file:

    • Remove any existing badges for Travis and/or Coveralls.

    • Add a badge with the following (substituting in the correct organization and repository name):

      [![Build Status]({organization}/{repository}/workflows/Continuous%20Integration/badge.svg)]({organization}/{repository}/actions?query=workflow%3A"Continuous+Integration")
  • Add and commit the GHA workflow, the .gitignore and .gitattribute files, the composer.lock file, and the file.

  • Push to your fork and create the PR. If there are any QA job failures, fix and push the changes.

Additional notes

  • If the package supports PHP ^5.6 | ^7.0, you will need to exclude locked runs for PHP 5.6 - 7.2. The way to do that is to create the .laminas-ci.json file if you haven't already, and ensure it has the following contents:

        "exclude": [
            {"name": "PHPUnit on PHP 5.6 with locked dependencies"},
            {"name": "PHPUnit on PHP 7.0 with locked dependencies"},
            {"name": "PHPUnit on PHP 7.1 with locked dependencies"},
            {"name": "PHPUnit on PHP 7.2 with locked dependencies"}
Copy link

boesing commented Apr 10, 2021

I'd prefer using the workflow filename so we dont have to use %20 or have to match the exact name of the workflow.
Can we update this GIST?

Copy link

internalsystemerror commented Apr 11, 2021

I believe the new one should be:

[![Build Status]({organization}/{repository}/actions/workflows/continuous-integration.yml/badge.svg)]({organization}/{repository}/actions/workflows/continuous-integration.yml)

Edit: Added missing actions/ part of the image path

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