Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM php:8.4-cli-alpine

COPY php.ini /usr/local/etc/php/php.ini

RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
&& apk add --no-cache linux-headers

RUN pecl install xdebug \
&& docker-php-ext-enable xdebug

COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

WORKDIR /app

COPY . /app
1 change: 1 addition & 0 deletions .docker/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xdebug.mode=develop,debug,coverage
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Bug report
description: |
Something didn't work as expected? Create a report to help us improve.
labels: [ "bug", "triage" ]
assignees: [ ]
body:
- type: markdown
attributes:
value: |
Example description
- type: input
id: pkg_version
attributes:
label: Package name version
description: Run `composer show -v | grep package/name`.
placeholder: "example: 1.0.0"
validations:
required: true
- type: input
id: php_version
attributes:
label: PHP version
description: Run `php -v`.
placeholder: "example: 8.4"
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: What happened?
description: |
Example description
placeholder: I ran `php artisan migration:fresh` on prod, and then...
validations:
required: true
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Question
description: Ask or suggest something.
labels: ["question", "triage"]
assignees: []
body:
- type: markdown
attributes:
value: |
Example description
- type: input
id: pkg_version
attributes:
label: Package name version
description: Run `composer show -v | grep package/name`.
placeholder: "example: 1.0.0"
validations:
required: true
- type: textarea
id: question
attributes:
label: Your question
placeholder:
validations:
required: true
38 changes: 0 additions & 38 deletions .github/workflows/code-standart.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: LINT

on: ['push']

jobs:
coding-standard:
name: Coding Standard
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup PHP 8.4
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: none
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, intl, gd

- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: vendor
key: composer-${{ hashFiles('composer.lock') }}

- name: Install dependencies
run: composer install

- name: Run lint code
run: composer lint
34 changes: 34 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: TESTS

on: ['push']

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- '8.4'
- '8.3'
- '8.2'

name: Tests (PHP ${{ matrix.php }} - ${{ matrix.deps }})

steps:
- uses: actions/checkout@v3
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: xdebug

- name: Install dependencies
run: composer update

- name: Test code
run: composer tests

- name: Test coverage
run: composer tests-coverage
7 changes: 0 additions & 7 deletions Dockerfile

This file was deleted.

8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

This repository is designed to give you a template with which you can create your own packages.

<a href="https://github.com/deniskorbakov/skeleton-php-docker"><img alt="GitHub Workflow Status" src="https://github.com/deniskorbakov/skeleton-php-docker/actions/workflows/code-standart.yml/badge.svg"></a>
<a href="https://github.com/deniskorbakov/skeleton-php-docker"><img alt="GitHub Workflow Status" src="https://github.com/deniskorbakov/skeleton-php-docker/actions/workflows/lint.yml/badge.svg"></a>
<a href="https://github.com/deniskorbakov/skeleton-php-docker"><img alt="GitHub Workflow Status" src="https://github.com/deniskorbakov/skeleton-php-docker/actions/workflows/tests.yml/badge.svg"></a>
<a href="https://packagist.org/packages/deniskorbakov/skeleton-php-docker"><img alt="Total Downloads" src="https://img.shields.io/packagist/dt/deniskorbakov/skeleton-php-docker"></a>
<a href="https://packagist.org/packages/deniskorbakov/skeleton-php-docker"><img alt="Latest Version" src="https://img.shields.io/packagist/v/deniskorbakov/skeleton-php-docker"></a>
<a href="https://packagist.org/packages/deniskorbakov/skeleton-php-docker"><img alt="License" src="https://img.shields.io/packagist/l/deniskorbakov/skeleton-php-docker"></a>
Expand Down Expand Up @@ -31,9 +32,12 @@ make init
## What do you get

* Ready-made template project using the latest version of PHP
* Tests using pest
* Tests/Test Coverage using pest
* Static analyzers: phpstan/rector/phpcs
* Ready-made environment using docker
* Xdebug mod
* GitHub actions for lint/tests
* Issue Template for bug/question


I would be glad to receive your **feedback**
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"require": {
"php": "^8.4.0"
"php": ">=8.1"
},
"autoload": {
"psr-4": {
Expand All @@ -25,8 +25,9 @@
},
"minimum-stability": "stable",
"scripts": {
"tests": "php ./vendor/bin/pest",
"cs-check": [
"tests": "pest --stop-on-failure --colors",
"tests-coverage": "pest --coverage --min=90",
"lint": [
"@phpstan",
"@cs",
"@rector"
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ services:
app:
container_name: scribe-plugin
build:
context: ./
context: .docker
volumes:
- ./:/app
tty: true
stdin_open: true
stdin_open: true
16 changes: 10 additions & 6 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@ up:
build:
docker compose up -d --build

# command for exec in container
# command for exec in app container
exec:
docker exec -it scribe-plugin /bin/sh

# command for install pkg
# command for install composer
install:
docker exec -i scribe-plugin composer install --dev

# command for run verify code
code-check:
docker exec -i scribe-plugin composer cs-check
# command for run lint code
lint:
docker exec -i scribe-plugin composer lint

# command for run tests
test:
docker exec -i scribe-plugin composer tests
docker exec -i scribe-plugin composer tests

# command for run tests coverage
test-coverage:
docker exec -i scribe-plugin composer tests
5 changes: 2 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
colors="true"
>
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
<testsuite name="Unit tests">
<directory>tests/Unit</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>app</directory>
<directory>src</directory>
</include>
</source>
Expand Down