Skip to content

Instantly share code, notes, and snippets.

@weierophinney
Created February 10, 2021 14:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weierophinney/9decd19f76b7d9745c6559074053fa65 to your computer and use it in GitHub Desktop.
Save weierophinney/9decd19f76b7d9745c6559074053fa65 to your computer and use it in GitHub Desktop.
CI workflow for Laminas packages (and any PHP package you want to use it on)
name: "Continuous Integration"
on:
pull_request:
push:
branches:
- '[0-9]+.[0-9]+.x'
- 'refs/pull/*'
tags:
jobs:
matrix:
name: Generate job matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- name: Gather CI configuration
id: matrix
uses: laminas/laminas-ci-matrix-action@v1
qa:
name: QA Checks
needs: [matrix]
runs-on: ${{ matrix.operatingSystem }}
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }}
steps:
- name: ${{ matrix.name }}
uses: laminas/laminas-continuous-integration-action@v1
with:
job: ${{ matrix.job }}
@weierophinney
Copy link
Author

To install:

$ mkdir -p .github/workflows ; cd  .github/workflows ; wget https://gist.githubusercontent.com/weierophinney/9decd19f76b7d9745c6559074053fa65/raw/6ffb33e59796cfec569405139aa65da9396ea5cd/continuous-integration.yml
$ git add .github/workflows/continuous-integration.yml
$ git commit
$ git push

@weierophinney
Copy link
Author

Some notes:

  • You should also add the composer.lock file to the repository! This MAY mean removing a composer.lock entry from the .gitignore file first.

  • Make sure you remove the .travis.yml file!

  • You can replace the README.md badges with the following:

    [![Build Status](https://github.com/laminas/laminas-{PACKAGE}/workflows/Continuous%20Integration/badge.svg)](https://github.com/laminas/laminas-{PACKAGE}/actions?query=workflow%3A"Continuous+Integration")

@Slamdunk
Copy link

Does also .coveralls.yml need to be removed?

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