-
-
Notifications
You must be signed in to change notification settings - Fork 20
Improved usage instructions in readme file #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+31
−2
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,16 @@ 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: | ||
|
||
jobs: | ||
matrix: | ||
name: Generate job matrix | ||
|
@@ -70,7 +79,6 @@ jobs: | |
- name: Gather CI configuration | ||
id: matrix | ||
uses: laminas/laminas-ci-matrix-action@v1 | ||
|
||
qa: | ||
name: QA Checks | ||
needs: [matrix] | ||
|
@@ -87,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/[email protected] | ||
``` | ||
|
||
> ### 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. | ||
Xerkus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
> ### 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. | ||
|
@@ -219,7 +250,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. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.