Skip to content

Commit

Permalink
feat: convert to a composite action
Browse files Browse the repository at this point in the history
This also adds the following features:

- Use `--prefer-stable` with lowest dependencies (#178)
- Allow use of a custom cache key (#167)
- Allow ability to ignore the cache

Fixes: #187, #161, #152, #79
  • Loading branch information
ramsey committed Dec 23, 2021
1 parent 994bb19 commit 081c245
Show file tree
Hide file tree
Showing 108 changed files with 3,043 additions and 260,446 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Expand Up @@ -7,6 +7,10 @@ root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 4

[*.{yml,yaml}]
indent_size = 2
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

54 changes: 0 additions & 54 deletions .eslintrc.json

This file was deleted.

14 changes: 13 additions & 1 deletion .gitattributes
@@ -1 +1,13 @@
dist/** -diff linguist-generated=true
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github/ export-ignore
/.gitignore export-ignore
/CHANGELOG.md export-ignore
/CODE_OF_CONDUCT.md export-ignore
/composer.json export-ignore
/composer.lock export-ignore
/CONTRIBUTING.md export-ignore
/docs/ export-ignore
/SECURITY.md export-ignore
/subdirectory/ export-ignore
/tests/ export-ignore
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
@@ -0,0 +1 @@
* @ramsey
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_Report.md
@@ -0,0 +1,35 @@
---
name: Bug Report
about: Create a bug report to help us improve
labels: bug
assignees:
---
<!--- Provide a general summary of the issue you're having in the title above. -->

## Description
<!-- Provide a short and clear description of the bug. -->

## Steps to reproduce
<!--
Provide steps to reproduce the behavior you are experiencing. Please try to keep
this as short as possible. If able, create a reproducible script outside of any
framework you are using. This will help us to quickly debug the issue.
-->
1. Step one...
2. Step two...
3. Step three...

## Expected behavior
<!-- Provide a short and clear description of what you expect to happen. -->

## Screenshots or output
<!-- If applicable, add screenshots or program output to help explain your problem. -->

## Environment details
<!-- Provide details about the system where you're using this package. -->
- version of this package: *e.g. 1.0.0, 1.0.1, 1.1.0*
- PHP version: *e.g. 7.3.16, 7.4.4*
- OS: *e.g. Windows 10, Linux (Ubuntu 18.04.1), macOS Catalina (10.15.3)*

## Additional context
<!-- Provide any additional context that may help us debug the problem. -->
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/Feature_Request.md
@@ -0,0 +1,31 @@
---
name: Feature Request
about: Suggest a feature for this project
labels: enhancement
assignees:
---
<!--- Provide a general summary of your feature request in the title above. -->

<!-- Give your feature a short title here. -->
## My feature title
<!-- Provide a short and clear description of the feature. -->

## Background/problem
<!--
Provide background details to show why this feature is necessary. Is your
feature request related to a problem? If so, please describe the problem.
Provide as much detail as possible.
-->

## Proposal/solution
<!--
Provide a short and clear description of the solution you'd like. Include code
examples, if possible. Feel free to use pseudo-code to show how you think the
feature should work.
-->

## Alternatives
<!-- Describe any alternative solutions or features you've considered. -->

## Additional context
<!-- Please provide any other context or code examples that may help. -->
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/Question.md
@@ -0,0 +1,19 @@
---
name: Question
about: Ask a question about how to use this library
labels: question
assignees:
---
<!--- Provide a general summary of your question in the title above. -->

<!-- Write your question here. -->
## How do I... ?
<!-- Provide any additional context that may help us answer your question. -->

## Example code
<!--
If your question is about code that you've written, provide a short and clear
example of what you're trying to accomplish. Try to keep this as short as
possible. If able, please provide an example outside of any framework you are
using. This will help us to quickly respond to your question.
-->
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1 @@
blank_issues_enabled: false
8 changes: 0 additions & 8 deletions .github/dependabot.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/pull_request_template.md
@@ -0,0 +1,27 @@
<!--- Provide a general summary of your changes in the title above. -->

## Description
<!--- Describe your changes in detail. -->

## Motivation and context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->

## How has this been tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## PR checklist
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the **CONTRIBUTING.md** document.
- [ ] I have added tests to cover my changes.
63 changes: 41 additions & 22 deletions .github/workflows/continuous-integration.yml
@@ -1,29 +1,31 @@
name: "CI"
# GitHub Actions Documentation: https://docs.github.com/en/actions

on:
pull_request:
push:
branches:
- "v[0-9]+"
name: "build"

jobs:
on: ["pull_request", "push"]

# Make sure build/ci work properly.
build:
name: "Build"
jobs:
test:
name: "Expect Tests"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
- uses: "shivammathur/setup-php@v2"
- name: "Checkout repository"
uses: "actions/checkout@v2"
- name: "Install expect"
run: |
sudo apt-get update
sudo apt-get -y install expect
- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "latest"
- run: "npm install"
- run: "npm run all"
- uses: "codecov/codecov-action@v1"
tools: "composer:v2"
coverage: "none"
- name: "Run expect tests"
run: "composer test"

# Make sure the action works on a clean machine without building.
test:
name: "Test"
run:
name: "Run Action"
runs-on: "${{ matrix.operating-system }}"
strategy:
matrix:
Expand All @@ -35,14 +37,31 @@ jobs:
- "highest"
- "locked"
composer-options:
- "--working-dir subdirectory"
- "--ignore-platform-reqs"
- ""
working-directory:
- "subdirectory"
- ""
ignore-cache:
- "yes"
- ""
custom-cache-key:
- "my-super-custom-cache-key"
- ""
steps:
- uses: "actions/checkout@v2"
- uses: "shivammathur/setup-php@v2"
- name: "Checkout repository"
uses: "actions/checkout@v2"
- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "latest"
- uses: ./
tools: "composer:v2"
coverage: "none"
- name: "Run composer-install action"
uses: ./
with:
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: "${{ matrix.composer-options }}"
working-directory: "${{ matrix.working-directory }}"
ignore-cache: "${{ matrix.ignore-cache }}"
custom-cache-key: "${{ matrix.custom-cache-key }}"

0 comments on commit 081c245

Please sign in to comment.