From 9c7101670248cdc12d7f43f449edd05d64f80cc4 Mon Sep 17 00:00:00 2001 From: "hubert.lenoir" Date: Mon, 5 Aug 2024 10:52:00 +0200 Subject: [PATCH] chore: update CI --- .github/workflows/ci.yml | 93 ------------------------------------ .github/workflows/static.yml | 51 ++++++++++++++++++++ .github/workflows/tests.yml | 49 +++++++++++++++++++ README.md | 7 +++ 4 files changed, 107 insertions(+), 93 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/static.yml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 173d6f9..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: 'CI' - -on: - push: - branches: ['main'] - pull_request: - branches: [ 'main' ] - schedule: - - cron: '0 0 * * *' - -env: - COMPOSER_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - -jobs: - php-cs-fixer: - name: 'PHP-CS-Fixer' - runs-on: 'ubuntu-latest' - strategy: - fail-fast: false - steps: - - name: 'Checkout' - uses: 'actions/checkout@v2' - - name: 'Setup PHP' - uses: 'shivammathur/setup-php@v2' - with: - php-version: '8.1' - ini-values: 'memory_limit=-1' - tools: 'php-cs-fixer' - coverage: 'none' - - name: 'Run PHP-CS-Fixer analysis' - run: 'php-cs-fixer fix --dry-run --diff --ansi' - - phpstan: - name: 'PHPStan' - runs-on: 'ubuntu-latest' - strategy: - fail-fast: false - steps: - - name: 'Checkout' - uses: 'actions/checkout@v2' - - name: 'Setup PHP' - uses: 'shivammathur/setup-php@v2' - with: - php-version: '8.2' - tools: 'composer' - coverage: 'none' - ini-values: 'memory_limit=-1' - - uses: 'ramsey/composer-install@v3' - - name: 'Cache PHPStan results' - uses: 'actions/cache@v2' - with: - path: '/tmp/phpstan' - key: 'phpstan-php${{ matrix.php }}-${{ github.sha }}' - restore-keys: | - phpstan-php${{ matrix.php }}- - phpstan- - continue-on-error: true - - name: 'Install PHPUnit' - run: 'vendor/bin/simple-phpunit --version' - - name: 'Run PHPStan analysis' - run: './vendor/bin/phpstan analyse --no-interaction --no-progress --ansi' - - phpunit: - name: 'PHPUnit' - runs-on: 'ubuntu-latest' - strategy: - matrix: - php: - - '7.4' - - '8.0' - - '8.1' - - '8.2' - dependencies-version: -# - 'lowest' - - 'highest' - fail-fast: false - steps: - - name: 'Checkout' - uses: 'actions/checkout@v2' - - name: 'Setup PHP' - uses: 'shivammathur/setup-php@v2' - with: - php-version: '${{ matrix.php }}' - tools: 'composer' - coverage: 'none' - ini-values: 'memory_limit=-1' - - uses: 'ramsey/composer-install@v3' - with: - dependency-versions: '${{ matrix.dependencies-version }}' - - name: 'Install PHPUnit' - run: 'vendor/bin/simple-phpunit --version' - - name: 'Run PHPUnit tests' - run: 'vendor/bin/simple-phpunit' diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 0000000..166b951 --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,51 @@ +name: 'Static analysis' + +on: + push: + branches: ['main'] + pull_request: + branches: ['main'] + +permissions: + contents: 'read' + +jobs: + + php-cs-fixer: + name: 'PHP CS Fixer' + runs-on: 'ubuntu-latest' + steps: + - uses: 'actions/checkout@v4' + + - name: 'Setup PHP' + uses: 'shivammathur/setup-php@v2' + with: + php-version: '8.3' + coverage: 'none' + + - name: 'Install dependencies' + uses: 'ramsey/composer-install@v3' + + - name: 'Run PHP CS Fixer' + run: 'php vendor/bin/php-cs-fixer check -v' + + phpstan: + name: 'PHPStan' + runs-on: 'ubuntu-latest' + steps: + - uses: 'actions/checkout@v4' + + - name: 'Setup PHP' + uses: 'shivammathur/setup-php@v2' + with: + php-version: '8.3' + coverage: 'none' + + - name: 'Install dependencies' + uses: 'ramsey/composer-install@v3' + + - name: 'Install PHPUnit' + run: 'vendor/bin/simple-phpunit --version' + + - name: 'Run PHPStan' + run: 'php vendor/bin/phpstan analyse --no-interaction --no-progress --ansi' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..9150d23 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,49 @@ +name: 'Tests' + +on: + push: + branches: ['main'] + pull_request: + branches: ['main'] + +permissions: + contents: 'read' + +jobs: + + phpunit: + name: 'PHPUnit' + runs-on: 'ubuntu-latest' + strategy: + matrix: + php: + - '7.4' + - '8.0' + - '8.1' + - '8.2' + - '8.3' + deps: +# - 'lowest' + - 'highest' + fail-fast: false + steps: + - name: 'Checkout' + uses: 'actions/checkout@v4' + + - name: 'Setup PHP' + uses: 'shivammathur/setup-php@v2' + with: + php-version: '${{ matrix.php }}' + tools: 'composer' + coverage: 'none' + ini-values: 'memory_limit=-1' + + - uses: 'ramsey/composer-install@v3' + with: + dependency-versions: '${{ matrix.deps }}' + + - name: 'Install PHPUnit' + run: 'vendor/bin/simple-phpunit --version' + + - name: 'Run PHPUnit tests' + run: 'vendor/bin/simple-phpunit' diff --git a/README.md b/README.md index 2ad0990..8a75dd5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,12 @@ # PipelineBundle +[![Latest Version](https://img.shields.io/github/release/Jean-Beru/pipeline-bundle.svg?style=flat-square)](https://github.com/Jean-Beru/pipeline-bundle/releases) +[![Total Downloads](https://poser.pugx.org/Jean-Beru/pipeline-bundle/downloads)](https://packagist.org/packages/Jean-Beru/pipeline-bundle) +[![Monthly Downloads](https://poser.pugx.org/Jean-Beru/pipeline-bundle/d/monthly.png)](https://packagist.org/packages/Jean-Beru/pipeline-bundle) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENCE) +[![Static analysis](https://github.com/Jean-Beru/pipeline-bundle/actions/workflows/static.yml/badge.svg?branch=main)](https://github.com/Jean-Beru/pipeline-bundle/actions/workflows/static.yml?query=branch%3Amain) +[![Tests](https://github.com/Jean-Beru/pipeline-bundle/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/Jean-Beru/pipeline-bundle/actions/workflows/tests.yml?query=branch%3Amain) + [Pipeline](https://github.com/thephpleague/pipeline) bundle for Symfony. ## Install