setup-php/.github/CONTRIBUTING.md

84 lines
2.9 KiB
Markdown
Raw Permalink Normal View History

2019-09-22 13:46:51 +07:00
# Contributing to setup-php
2022-01-29 08:59:03 +07:00
## Welcome!
2019-09-22 13:46:51 +07:00
2022-01-29 08:59:03 +07:00
We look forward to your contributions! Here are some examples how you can contribute:
2019-09-22 13:46:51 +07:00
2022-01-29 08:59:03 +07:00
* [Ask any questions you may have](https://github.com/shivammathur/setup-php/discussions/new?category=Q-A-Help)
* [Report a bug](https://github.com/shivammathur/setup-php/issues/new?labels=type/bug&template=bug.md)
* [Propose a new feature](https://github.com/shivammathur/setup-php/issues/new?labels=enhancement&template=feature.md)
* [Send a pull request](https://github.com/shivammathur/setup-php/pulls)
2019-09-22 13:46:51 +07:00
2022-01-29 08:59:03 +07:00
## Contributor Code of Conduct
2019-09-22 13:46:51 +07:00
2022-01-29 08:59:03 +07:00
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
2019-09-22 13:46:51 +07:00
2022-01-29 08:59:03 +07:00
## Getting Started
2019-09-22 13:46:51 +07:00
2022-01-29 08:59:03 +07:00
To get started fork `setup-php` and clone it using git:
2019-09-22 13:46:51 +07:00
2022-01-29 08:59:03 +07:00
```bash
git clone https://github.com/<your-username>/setup-php.git
2019-09-22 13:46:51 +07:00
2022-01-29 08:59:03 +07:00
cd setup-php
```
2019-09-22 13:46:51 +07:00
2022-01-29 08:59:03 +07:00
If you are using `Windows` configure `git` to handle line endings.
2019-09-22 13:46:51 +07:00
2022-01-29 08:59:03 +07:00
```cmd
git config --local core.autocrlf true
2019-09-22 13:46:51 +07:00
```
2022-01-29 08:59:03 +07:00
Install `setup-php` dependencies using [npm](https://www.npmjs.com/):
2019-09-22 13:46:51 +07:00
```bash
2022-01-29 08:59:03 +07:00
npm install
2019-09-22 13:46:51 +07:00
```
2022-01-29 08:59:03 +07:00
## Workflow to create Pull Requests
2020-10-31 16:25:27 +07:00
2022-01-29 08:59:03 +07:00
* Fork the `setup-php` project and clone it.
* Create a new branch from the develop branch.
* Make your bug fix or feature addition.
* Add tests for it, so we don't break it in a future version unintentionally.
* Ensure the test suite passes and the code complies with our coding guidelines (see below).
* Send a pull request to the develop branch with all the details.
* If possible, create a GitHub Actions workflow with an integration test for the change in a demo repository and link it in your pull request.
Please make sure that you have [set up your user name and email address](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup) for use with Git. Strings such as `silly nick name <root@localhost>` look really stupid in the commit history of a project.
Due to time constraints, you may not always get a quick response. Please do not take delays personally and feel free to remind.
## Coding Guidelines
2020-10-31 16:25:27 +07:00
This project comes with `.prettierrc.json` and `eslintrc.json` configuration files. Please run the following commands to fix and verify the code quality.
```bash
2022-01-29 08:59:03 +07:00
npm run format
npm run lint
2020-10-31 16:25:27 +07:00
```
2022-01-29 08:59:03 +07:00
### Running the test suite
2019-09-22 13:46:51 +07:00
After following the steps shown above, The `setup-php` tests in the `__tests__` directory can be run using this command:
```bash
2022-01-29 08:59:03 +07:00
npm test
2019-09-22 13:46:51 +07:00
```
2022-01-29 08:59:03 +07:00
### Creating a release
2019-11-25 23:36:40 +07:00
2022-01-29 08:59:03 +07:00
Creating a release means compiling all the TypeScript code to a single file which `setup-php` can run. Run this, before you push your changes.
2019-11-25 23:36:40 +07:00
```bash
2023-06-12 06:15:59 +07:00
npm run build
2022-01-29 08:59:03 +07:00
npm run release
2019-11-25 23:36:40 +07:00
```
2022-01-29 08:59:03 +07:00
### Reporting issues and discussions
2019-09-22 13:46:51 +07:00
2022-01-29 08:59:03 +07:00
For questions or support, we prefer GitHub Discussions. For any bugs or new features you can create an issue using the appropriate template:
2019-09-22 13:46:51 +07:00
2022-01-29 08:59:03 +07:00
* [Discussions](https://github.com/shivammathur/setup-php/discussions)
2020-05-16 12:58:01 +07:00
* [Issues](https://github.com/shivammathur/setup-php/issues)