From 7d6b8f4400ab9da1446f92f9961b4d3c23b7bd4b Mon Sep 17 00:00:00 2001 From: Razvan Grigore Date: Tue, 30 Jan 2024 07:02:24 +0200 Subject: [PATCH] Add PHP_CodeSniffer --- .github/workflows/lint.yaml | 26 +++++++++++++++++++++++++ .github/workflows/test.yml | 3 +++ README.md | 6 ++++-- phpcs.xml | 38 +++++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/lint.yaml create mode 100644 phpcs.xml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..2717757 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,26 @@ +name: PHP code quality + +on: + push: + branches: + - master + paths-ignore: + - README.md + pull_request: + workflow_dispatch: + +jobs: + run: + runs-on: ubuntu-latest + name: PHP_CodeSniffer + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + tools: cs2pr, phpcs + + - name: Run phpcs + run: phpcs -q --report=checkstyle . | cs2pr diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a1c32ce..6950d47 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,6 +25,9 @@ jobs: php-version: ${{ matrix.php-version }} tools: composer:v2 + - name: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + - name: Get composer cache directory id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT diff --git a/README.md b/README.md index f9e121d..4605d36 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # PHP PASSBOOK LIBRARY -[![CircleCI](https://circleci.com/gh/eymengunay/php-passbook.svg?style=shield)](https://circleci.com/gh/eymengunay/php-passbook) +[![Code Coverage](https://scrutinizer-ci.com/g/eymengunay/php-passbook/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/eymengunay/php-passbook/?branch=master) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/eymengunay/php-passbook/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/eymengunay/php-passbook/?branch=master) +[![Build Status](https://scrutinizer-ci.com/g/eymengunay/php-passbook/badges/build.png?b=master)](https://scrutinizer-ci.com/g/eymengunay/php-passbook/build-status/master) [![Total Downloads](https://img.shields.io/packagist/dt/eo/passbook.svg)](https://packagist.org/packages/eo/passbook) [![Latest Stable Version](https://img.shields.io/packagist/v/eo/passbook.svg)](https://packagist.org/packages/eo/passbook) @@ -49,7 +51,7 @@ This example will create a pass of type Ticket and will save the pkpass file in * [Obtain a Pass Type Identifier and Team Identifier from Apple](#obtaining-the-pass-type-identifier-and-team-id) * Get an icon (29x29 png file) for the pass * Specify a name for your organization -* Specify the output path where the pass will be saved
 +* Specify the output path where the pass will be saved ```php + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /vendor/* + +