Skip to content

Commit

Permalink
Merge branch 'master' into fix-warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
garak authored Dec 14, 2024
2 parents 35cc5e9 + bae5436 commit 08ae7fa
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/.git* export-ignore
/*.yml export-ignore
/phpunit.xml.dist export-ignore
/README.md export-ignore
/README-it.md export-ignore
/test export-ignore
48 changes: 48 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Contributing

## Quick Guide

1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local machine.
2. Install the dependencies (`composer install --dev`)
3. Create a new branch (`git checkout -b feat/new-feature`)
4. Write your feature or fix and make sure tests pass and code standards are met (see below)
5. Commit your changes (`git commit -m 'feat(new-feature): some feature or fix'`)
6. Push to the branch (`git push origin feat/new-feature`)
7. Open a pull request

## Working with Docker 🐳

This project provides a Docker setup that allows working on it using any of the supported PHP versions.

To use it, you first need to install:

* [Docker](https://docs.docker.com/get-docker/)
* [Docker Compose](https://docs.docker.com/compose/install/)

Make sure the versions installed support [Compose file format 3.9](https://docs.docker.com/compose/compose-file/).

You can then build the images:

```console
docker compose up --build -d
```

Now you can run commands needed to work on the project. For example, say you want to install the dependencies on PHP 8.0:

```console
docker-compose run codice-fiscale-php-80 composer install
```

or for enter the container

```console
docker-compose exec codice-fiscale-php-80 sh
```

## Testing

To run the test use the command below:

```bash
composer test
```
2 changes: 1 addition & 1 deletion README-it.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ Test
----

``` bash
$ vendor\bin\phpunit
$ composer test
```


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ Test
----

``` bash
$ vendor\bin\phpunit
$ composer test
```


Expand Down
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,11 @@
"name": "davidepastore",
"email": "[email protected]"
}
]
],
"config": {
"sort-packages": true
},
"scripts": {
"test": "vendor/bin/phpunit"
}
}
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3.9'

services:
codice-fiscale-71:
build: docker/php-7.1
container_name: codice-fiscale-php-71
working_dir: /app
tty: true
volumes:
- .:/app:cached

codice-fiscale-80:
build: docker/php-8.0
container_name: codice-fiscale-php-80
working_dir: /app
tty: true
volumes:
- .:/app:cached
3 changes: 3 additions & 0 deletions docker/php-7.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM php:7.1-alpine3.9

COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
3 changes: 3 additions & 0 deletions docker/php-8.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM php:8.0-cli-alpine3.16

COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
colors="true"
>
<testsuites>
<testsuite name="codice-fiscale test suite">
<testsuite name="Codice Fiscale test suite">
<directory>./test</directory>
</testsuite>
</testsuites>
Expand Down

0 comments on commit 08ae7fa

Please sign in to comment.