Skip to content

Commit d93f93f

Browse files
authored
Merge pull request #5 from nevadskiy/dev
New release
2 parents a4d9ac2 + 0b902b5 commit d93f93f

39 files changed

+593
-7152
lines changed

.docker/php7.2/Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Image
2+
FROM php:7.2-cli
3+
4+
# Starting from scratch
5+
RUN apt-get update \
6+
# Zip
7+
&& apt-get install -y libzip-dev zip \
8+
&& docker-php-ext-install zip \
9+
# PCOV
10+
&& pecl install pcov \
11+
&& docker-php-ext-enable pcov
12+
13+
# Composer
14+
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
15+
16+
# Set up default directory
17+
WORKDIR /app

.docker/php7.3/Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Specify the image
2+
FROM php:7.3-cli
3+
4+
# Update dependencies
5+
RUN apt-get update \
6+
# Install Zip
7+
&& apt-get install -y libzip-dev zip \
8+
&& docker-php-ext-install zip
9+
10+
# Install Composer
11+
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
12+
13+
# Specify the working directory
14+
WORKDIR /app

.docker/php7.4/Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Specify the image
2+
FROM php:7.4-cli
3+
4+
# Update dependencies
5+
RUN apt-get update \
6+
# Install Zip
7+
&& apt-get install -y libzip-dev zip \
8+
&& docker-php-ext-install zip
9+
10+
# Install Composer
11+
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
12+
13+
# Specify the working directory
14+
WORKDIR /app

.docker/php8.0/Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Specify the image
2+
FROM php:8.0-cli
3+
4+
# Update dependencies
5+
RUN apt-get update \
6+
# Install Zip
7+
&& apt-get install -y libzip-dev zip \
8+
&& docker-php-ext-install zip
9+
10+
# Install Composer
11+
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
12+
13+
# Specify the working directory
14+
WORKDIR /app

.docker/php8.1/Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Specify the image
2+
FROM php:8.1-cli
3+
4+
# Update dependencies
5+
RUN apt-get update \
6+
# Install Zip
7+
&& apt-get install -y libzip-dev zip \
8+
&& docker-php-ext-install zip
9+
10+
# Install Composer
11+
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
12+
13+
# Specify the working directory
14+
WORKDIR /app

.docker/php8.2/Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Specify the image
2+
FROM php:8.2-cli
3+
4+
# Update dependencies
5+
RUN apt-get update \
6+
# Install Zip
7+
&& apt-get install -y libzip-dev zip \
8+
&& docker-php-ext-install zip
9+
10+
# Install Composer
11+
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
12+
13+
# Specify the working directory
14+
WORKDIR /app

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_size = 4
6+
indent_style = space
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2

.gitattributes

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Defining git attributes per path
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
/.docker export-ignore
5+
/.github export-ignore
6+
/tests export-ignore
7+
/.editorconfig export-ignore
8+
/.gitattributes export-ignore
9+
/.gitignore export-ignore
10+
/.php-cs-fixer.dist.php export-ignore
11+
/CHANGELOG.md export-ignore
12+
/docker-compose.yml export-ignore
13+
/Makefile export-ignore
14+
/phpunit.xml.dist export-ignore

.github/CONTRIBUTING.md

+26-32
Original file line numberDiff line numberDiff line change
@@ -4,62 +4,56 @@ Contributions are **welcome** and will be fully **credited**.
44

55
We accept contributions via Pull Requests.
66

7-
87
## Pull Requests
98

10-
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
9+
- **Add tests** - Your patch won't be accepted if it doesn't have tests.
1110

12-
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
11+
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/).
1312

14-
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
13+
- **Document any change in behaviour** - Make sure the [README.md](../README.md) and any other relevant documentation are kept up-to-date.
1514

1615
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
1716

18-
**Happy coding**!
19-
20-
2117
## Setup
2218

23-
The project setup is based upon [Docker](https://docs.docker.com/engine/install).
19+
The project setup is based upon [docker](https://docs.docker.com/engine/install).
2420

25-
For convenience, common tasks are wrapped up in the [Makefile](Makefile) for usage with [GNU make](https://www.gnu.org/software/make/).
21+
For convenience, common tasks are wrapped up in the [Makefile](../Makefile) for usage with [GNU make](https://www.gnu.org/software/make/).
2622

27-
1. Fork and clone the project
23+
## Installation
2824

29-
2. Run the installation command
25+
Fork and clone the project:
3026

27+
```bash
28+
git clone https://github.com/nevadskiy/laravel-position.git
3129
```
32-
# Using global composer
33-
composer install
3430

35-
# Using docker & makefile
36-
make install
31+
Build docker containers:
32+
33+
```bash
34+
docker compose build
3735
```
3836

37+
Install the composer dependencies:
3938

40-
## Running Tests
39+
```bash
40+
docker compose run --rm composer install
41+
```
4142

42-
To execute testsuite, run the following command:
43+
## Running Tests
4344

44-
``` bash
45-
# Using global composer
46-
composer test
45+
To run tests, execute the following command:
4746

48-
# Using docker & makefile
49-
make test
47+
```bash
48+
docker compose run --rm phpunit
5049
```
5150

52-
5351
## Code Style
5452

55-
Formatting is automated through [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) and Github Actions.
56-
57-
To fix the code style manually, run the following command:
53+
Formatting is automated through [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer)
5854

59-
``` bash
60-
# Using global composer
61-
composer fix
62-
63-
# Using docker & makefile
64-
make fix
55+
```bash
56+
docker compose run --rm php-cs-fixer fix
6557
```
58+
59+
**Happy coding**!

.github/workflows/code-style.yml

-35
This file was deleted.

.github/workflows/php-cs-fixer.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: PHP CS Fixer
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
test:
7+
name: Run PHP CS Fixer
8+
9+
runs-on: ubuntu-latest
10+
11+
env:
12+
PHP_VERSION: 7.3
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
- name: Build containers
19+
run: docker compose build composer php-cs-fixer
20+
21+
- name: Install Composer dependencies
22+
run: docker compose run composer install --no-interaction --no-progress
23+
24+
- name: Run PHP CS Fixer
25+
run: docker compose run php-cs-fixer fix --dry-run

.github/workflows/phpunit.yml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: PHPUnit
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
test:
7+
name: Run PHPUnit on PHP ${{ matrix.php }} with ${{ matrix.dependencies }} dependencies
8+
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
15+
dependencies: [ 'lowest', 'highest' ]
16+
exclude:
17+
- php: '8.0'
18+
dependencies: 'lowest'
19+
- php: '8.1'
20+
dependencies: 'lowest'
21+
- php: '8.2'
22+
dependencies: 'lowest'
23+
24+
env:
25+
PHP_VERSION: ${{ matrix.php }}
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v2
30+
31+
- name: Build containers
32+
run: docker compose build
33+
34+
- name: Install Composer dependencies with the highest version
35+
if: matrix.dependencies == 'highest'
36+
run: docker compose run composer update --no-interaction --no-progress
37+
38+
- name: Install Composer dependencies with the lowest stable version
39+
if: matrix.dependencies == 'lowest'
40+
run: docker compose run composer update --no-interaction --no-progress --prefer-lowest --prefer-stable
41+
42+
- name: Run PHPUnit
43+
run: docker compose run phpunit
44+
45+
coverage:
46+
name: Analyze code coverage
47+
48+
runs-on: ubuntu-latest
49+
50+
env:
51+
PHP_VERSION: 7.2
52+
53+
steps:
54+
- name: Checkout code
55+
uses: actions/checkout@v2
56+
57+
- name: Build containers
58+
run: docker compose build
59+
60+
- name: Install Composer dependencies
61+
run: docker compose run composer update --no-interaction --no-progress
62+
63+
- name: Run PHPUnit with a coverage analysis
64+
run: docker compose run phpunit --coverage-clover coverage.xml
65+
66+
- name: Upload the coverage report
67+
uses: codecov/codecov-action@v3

0 commit comments

Comments
 (0)