Skip to content

Commit

Permalink
Update the guidelines for contributions
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegamez committed Jul 30, 2023
1 parent 45c43ed commit ce2b746
Showing 1 changed file with 8 additions and 40 deletions.
48 changes: 8 additions & 40 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,13 @@
# Contributing

## Local Setup
This project is not looking for code contributions other than bug fixes. A
(non-exhaustive) list of changes that will most probably not be merged contains:

### Prerequisites
* code optimizations - create an issue instead to discuss it
* unsolicited feature additions
* extensive code changes

1. PHP 8.1.0 or higher.
2. `composer` 2.4 or higher.
In short: please discuss planned changes by opening a new issue.

### Initial Setup

```shell
composer install
composer install-tools
```

### Running the Tests

The project is set up with PHPStan for static analysis as well as Unit tests and Integration tests.

```shell
# Run PHPStan and Unit Tests
composer test
# Run PHPStan only
vendor/bin/phpstan
# Run Unit Tests only
vendor/bin/phpunit --testsuite=unit
# Run Integration Tests only
vendor/bin/phpunit --testsuite=integration
# Generate test coverage report into ./build/coverage
composer test-coverage
# Apply code style
composer cs
```

The integration tests in this project require a working firebase project and a number of setup steps to pass locally.

* Create a new [Firebase Project](https://console.firebase.google.com/).
* Generate and download a private key for a service account to `tests/_fixtures/test_credentials.json`.
* Create a Realtime Database and save its url as a JSON string to `tests/_fixtures/test_rtdb.json`.
* Follow these [instructions](https://github.com/firebase/quickstart-js/tree/master/messaging) on how to generate a
Cloud Messaging device token and save the token as a JSON array to `tests/_fixtures/test_devices.json`.
* Setup [multi tenancy](https://cloud.google.com/identity-platform/docs/multi-tenancy-quickstart) create a tenant, and
save its ID as a string to `tests/_fixtures/test_tenant.json`.
* Enable Email/Password Sign-in method in Firebase Authentication.
Support the project's development and keep it sustainable by becoming a
[GitHub Sponsor](https://github.com/sponsors/jeromegamez).

0 comments on commit ce2b746

Please sign in to comment.