Skip to content

Commit

Permalink
feat(migrate): migrado para php >= 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mazinsw committed Aug 18, 2023
1 parent d131fe0 commit 6dfb40b
Show file tree
Hide file tree
Showing 33 changed files with 3,012 additions and 1,473 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Pipeline
on:
push:
branches:
- master

pull_request:
branches:
- master

jobs:
testsuite:
name: Testes Automatizados
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ["8.0", "8.1", "8.2"]

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, curl, zlib, dom, openssl, soap, json, simplexml, libxml

- name: checkout
uses: actions/checkout@v3
with:
# Fetch 10 commits or Scrutinizer will throw ("Failed to retrieve commit parents. If you use a shallow git checkout, please checkout at least a depth of one."), see: RepositoryIntrospector at scrutinizer-ci/ocular GitHub repository
# 10 commits is an arbitrary value that is more than 1 commit
fetch-depth: 10

- name: Composer Install
run: composer install --no-progress -o --no-ansi --no-interaction

- name: Check php code style
run: composer check-style

- name: Análises estáticas
run: composer analysis

- name: Rodando PHPUnit
run: composer test

- name: Enviando cobertura de código
run: php vendor/bin/ocular code-coverage:upload --format=php-clover build/logs/clover.xml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ $RECYCLE.BIN/
storage/
vendor/
build/
.phpunit.result.cache
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

83 changes: 83 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Makefile for Docker Nginx PHP Composer MySQL

export CURRENT_UID

CURRENT_UID= $(shell id -u):$(shell id -g)

help:
@echo ""
@echo "usage: make COMMAND"
@echo ""
@echo "Commands:"
@echo " install Install PHP dependencies with composer"
@echo " update Update PHP dependencies with composer"
@echo " autoload Update PHP autoload files"
@echo " test Run PHPUnit Tests"
@echo " cmd Open terminal with php"

install:
@docker run --rm \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
grandchef/composer:2.8.2 install --ignore-platform-reqs --no-scripts --no-interaction

update:
@docker run --rm \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
grandchef/composer:2.8.2 update --no-scripts --no-interaction

autoload:
@docker run --rm \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
grandchef/composer:2.8.2 dump-autoload --no-scripts --no-interaction

test:
@docker run --rm -it \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-w /app \
grandchef/php:8.2.2-fpm-dev php ./vendor/bin/phpunit --configuration . --no-coverage --colors=always

analisys:
@docker run --rm -it \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
-w /app \
grandchef/composer:2.8.2 composer analysis

check:
@docker run --rm -it \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
-w /app \
grandchef/composer:2.8.2 composer check-style

fix:
@docker run --rm -it \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
-w /app \
grandchef/composer:2.8.2 composer psr-fix

cmd:
@docker run --rm -it \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
-w /app \
grandchef/composer:2.8.2 /bin/bash
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
## Library to generate buffer for thermal printers

[![Latest Version on Packagist][ico-version]][link-packagist]
[![Build Status][ico-travis]][link-travis]
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
[![Quality Score][ico-code-quality]][link-code-quality]
[![Total Downloads][ico-downloads]][link-downloads]
Expand Down Expand Up @@ -55,7 +54,6 @@ Please see [license file](/LICENSE.txt) for more information.
[ico-downloads]: https://poser.pugx.org/mazinsw/escpos/d/total.svg

[link-packagist]: https://packagist.org/packages/mazinsw/escpos
[link-travis]: https://travis-ci.org/mazinsw/escpos
[link-scrutinizer]: https://scrutinizer-ci.com/g/mazinsw/escpos/code-structure
[link-code-quality]: https://scrutinizer-ci.com/g/mazinsw/escpos
[link-downloads]: https://packagist.org/packages/mazinsw/escpos
Expand Down
18 changes: 11 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
}
],
"require": {
"php": ">= 7.1.0",
"php": ">= 7.3.0",
"ext-mbstring": "*",
"endroid/qr-code": "^3.5.8"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"scrutinizer/ocular": "@stable",
"squizlabs/php_codesniffer": "@stable"
"phpunit/phpunit": "^9.5",
"scrutinizer/ocular": "^1.6",
"squizlabs/php_codesniffer": "^3.6",
"phpstan/phpstan": "^1.5"
},
"autoload": {
"psr-4": {
Expand All @@ -40,11 +41,14 @@
"cover": [
"phpunit --coverage-html storage/coverage"
],
"check": [
"phpcs --standard=psr2 src/Thermal tests"
"check-style": [
"phpcs --colors --standard=psr2 src/Thermal tests"
],
"fix": [
"psr-fix": [
"phpcbf --standard=psr2 src/Thermal tests"
],
"analysis": [
"phpstan analyse src/"
]
}
}
Loading

0 comments on commit 6dfb40b

Please sign in to comment.