From a9dd67cf53df796693c83390830e5299aa617fa1 Mon Sep 17 00:00:00 2001 From: Gennadiy Litvinyuk Date: Thu, 1 Apr 2021 22:52:52 +0200 Subject: [PATCH 1/4] Update README.md Improved usage instructions Fixed docker image name in local usage example Signed-off-by: Gennadiy Litvinyuk --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 86dc3ce..dc71769 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,19 @@ Generally speaking, you will use this in combination with the [laminas/laminas-c ## Usage +Create `.github/workflows/continuous-integration.yml` file with following content: + ```yaml +name: "Continuous Integration" + +on: + pull_request: + push: + branches: + - '[0-9]+.[0-9]+.x' + - 'refs/pull/*' + tags: + jobs: matrix: name: Generate job matrix @@ -219,7 +231,7 @@ The tricks to remember are: As an example, if you wanted to run the CS checks under PHP 7.4 using locked dependencies, you could do something like the following: ```bash -$ docker run -v $(realpath .):/github/workspace -w=/github/workspace laminas-check-runner:latest '{"php":"7.4","dependencies":"locked","extensions":[],"ini":["memory_limit=-1"],"command":"./vendor/bin/phpcs"}' +$ docker run -v $(realpath .):/github/workspace -w=/github/workspace ghcr.io/laminas/laminas-continuous-integration:1 '{"php":"7.4","dependencies":"locked","extensions":[],"ini":["memory_limit=-1"],"command":"./vendor/bin/phpcs"}' ``` The trick to remember: the job JSON should generally be in single quotes, to allow the `"` characters used to delimit properties and strings in the JSON to not cause interpolation issues. From 4901d140c6c704e82e9fa1e1836b6bfc9194fda2 Mon Sep 17 00:00:00 2001 From: Gennadiy Litvinyuk Date: Sat, 3 Apr 2021 13:20:07 +0200 Subject: [PATCH 2/4] Update README.md Changed events Signed-off-by: Gennadiy Litvinyuk --- README.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index dc71769..9eebccd 100644 --- a/README.md +++ b/README.md @@ -64,13 +64,7 @@ Create `.github/workflows/continuous-integration.yml` file with following conten ```yaml name: "Continuous Integration" -on: - pull_request: - push: - branches: - - '[0-9]+.[0-9]+.x' - - 'refs/pull/*' - tags: +on: [push, pull_request] jobs: matrix: @@ -82,7 +76,6 @@ jobs: - name: Gather CI configuration id: matrix uses: laminas/laminas-ci-matrix-action@v1 - qa: name: QA Checks needs: [matrix] From b6da79e923d24d892b2c89723fc1c293acd67c59 Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Thu, 1 Feb 2024 02:48:38 +1000 Subject: [PATCH 3/4] Add example with reusable workflow and mention possibility of duplicate CI runs Signed-off-by: Aleksei Khudiakov --- README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9eebccd..22fd29c 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,10 @@ Create `.github/workflows/continuous-integration.yml` file with following conten ```yaml name: "Continuous Integration" -on: [push, pull_request] +on: + pull_request: + push: + branches: jobs: matrix: @@ -92,6 +95,29 @@ jobs: job: ${{ matrix.job }} ``` +Same can be achieved with our reusable workflow : + +```yaml +name: "Continuous Integration" + +on: + pull_request: + push: + branches: + +jobs: + ci: + uses: laminas/workflow-continuous-integration/.github/workflows/continuous-integration.yml@1.x +``` + +> ### Duplicate CI runs +> +> When pull requests are opened from branches in the same repository CI pipeline could run twice for the same commit: +> once when pushed to a branch and once when PR is opened. Workflow triggers could be adjusted to only run for +> specific branches or to skip branches using simple glob patterns. +> See [Events that trigger workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-only-when-a-push-to-specific-branches-occurs) +> for more info. + > ### actions/checkout not required > > The action will perform a checkout of the repository at the requested reference as part of its work, and therefore does not require the actions/checkout action as a preceding step. From 7cd29f42def80215cadbaf3a79f8d65a902c2bb9 Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Thu, 1 Feb 2024 04:29:24 +1000 Subject: [PATCH 4/4] Apply suggestions from review Co-authored-by: Matthew Weier O'Phinney Signed-off-by: Aleksei Khudiakov --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 22fd29c..90e4627 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ jobs: job: ${{ matrix.job }} ``` -Same can be achieved with our reusable workflow : +The same can be achieved with our reusable workflow: ```yaml name: "Continuous Integration" @@ -112,11 +112,9 @@ jobs: > ### Duplicate CI runs > -> When pull requests are opened from branches in the same repository CI pipeline could run twice for the same commit: -> once when pushed to a branch and once when PR is opened. Workflow triggers could be adjusted to only run for -> specific branches or to skip branches using simple glob patterns. -> See [Events that trigger workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-only-when-a-push-to-specific-branches-occurs) -> for more info. +> When pull requests are opened from branches in the same repository, the CI pipeline could run twice for the same commit: once when pushed to a branch and once when the PR is opened. +> Workflow triggers can be adjusted to only run for specific branches or to skip branches using simple glob patterns. +> See the GitHub documentation for [Events that trigger workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-only-when-a-push-to-specific-branches-occurs) for more info. > ### actions/checkout not required >