From 09703ef138dfa85ff09b5c6861a0406e554bcd3e Mon Sep 17 00:00:00 2001 From: julien Date: Wed, 6 Oct 2021 16:05:43 +0200 Subject: [PATCH] feature/update-gh-actions : update gh actions --- .github/workflows/actions.yml | 60 -------------------------------- .github/workflows/infection.yaml | 34 ++++++++++++++++++ .github/workflows/phpstan-5.yaml | 23 ++++++++++++ .github/workflows/phpstan-7.yaml | 23 ++++++++++++ .github/workflows/phpstan-8.yaml | 23 ++++++++++++ .github/workflows/quality.yaml | 44 +++++++++++++++++++++++ 6 files changed, 147 insertions(+), 60 deletions(-) delete mode 100644 .github/workflows/actions.yml create mode 100644 .github/workflows/infection.yaml create mode 100644 .github/workflows/phpstan-5.yaml create mode 100644 .github/workflows/phpstan-7.yaml create mode 100644 .github/workflows/phpstan-8.yaml create mode 100644 .github/workflows/quality.yaml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml deleted file mode 100644 index 79f8adb..0000000 --- a/.github/workflows/actions.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Quality -on: push -jobs: - cs-fixer: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Cs-Fixer - run: | - wget -q https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer - chmod a+x php-cs-fixer - PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run - - phpstan: - runs-on: ubuntu-latest - strategy: - matrix: - phpstan-level: [ 3, 5, 7, 8 ] - steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v2 - with: - path: '**/vendor' - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - uses: php-actions/composer@v5 - with: - args: --prefer-dist - php_version: 8.0 - - - name: PHPStan - uses: php-actions/phpstan@v2 - with: - path: src/ - args: --level=${{ matrix.phpstan-level }} - - phpspec: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: php-actions/composer@v5 - with: - args: --prefer-dist - php_version: 8.0 - extensions: xdebug - - name: PHPSpec - run: bin/phpspec run spec - - phpunit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: php-actions/composer@v5 - with: - args: --prefer-dist - php_version: 8.0 - extensions: xdebug - - name: PHPUnit - run: bin/phpunit tests diff --git a/.github/workflows/infection.yaml b/.github/workflows/infection.yaml new file mode 100644 index 0000000..9d077b6 --- /dev/null +++ b/.github/workflows/infection.yaml @@ -0,0 +1,34 @@ +name: Mutations +on: push +jobs: + infection: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + tools: composer:v2 + coverage: pcov + - uses: actions/cache@v2 + with: + path: '**/vendor' + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + - uses: php-actions/composer@v5 + with: + args: --prefer-dist + php_version: 8.0 + + - name: Infection + run: | + wget -q https://github.com/infection/infection/releases/download/0.20.0/infection.phar + wget -q https://github.com/infection/infection/releases/download/0.20.0/infection.phar.asc + chmod +x infection.phar + ./infection.phar + + - name: Store infection log + uses: actions/upload-artifact@v2 + with: + path: infection.log diff --git a/.github/workflows/phpstan-5.yaml b/.github/workflows/phpstan-5.yaml new file mode 100644 index 0000000..8a87995 --- /dev/null +++ b/.github/workflows/phpstan-5.yaml @@ -0,0 +1,23 @@ +name: PHPStan level 5 +on: push +jobs: + phpstan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: '**/vendor' + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + - uses: php-actions/composer@v5 + with: + args: --prefer-dist + php_version: 8.0 + - name: PHPStan + uses: php-actions/phpstan@v2 + with: + path: src/ + level: 5 + php_version: 8.0 diff --git a/.github/workflows/phpstan-7.yaml b/.github/workflows/phpstan-7.yaml new file mode 100644 index 0000000..5199e66 --- /dev/null +++ b/.github/workflows/phpstan-7.yaml @@ -0,0 +1,23 @@ +name: PHPStan level 7 +on: push +jobs: + phpstan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: '**/vendor' + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + - uses: php-actions/composer@v5 + with: + args: --prefer-dist + php_version: 8.0 + - name: PHPStan + uses: php-actions/phpstan@v2 + with: + path: src/ + level: 7 + php_version: 8.0 diff --git a/.github/workflows/phpstan-8.yaml b/.github/workflows/phpstan-8.yaml new file mode 100644 index 0000000..be972ff --- /dev/null +++ b/.github/workflows/phpstan-8.yaml @@ -0,0 +1,23 @@ +name: PHPStan level 8 +on: push +jobs: + phpstan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: '**/vendor' + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + - uses: php-actions/composer@v5 + with: + args: --prefer-dist + php_version: 8.0 + - name: PHPStan + uses: php-actions/phpstan@v2 + with: + path: src/ + level: 8 + php_version: 8.0 diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml new file mode 100644 index 0000000..ff43381 --- /dev/null +++ b/.github/workflows/quality.yaml @@ -0,0 +1,44 @@ +name: Quality (PHPStan level 4) +on: push +jobs: + cs-fixer: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Cs-Fixer + run: | + wget -q https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer + chmod a+x php-cs-fixer + PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run + + phpspec: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: php-actions/composer@v5 + with: + args: --prefer-dist + php_version: 8.0 + - name: PHP Spec + run: bin/phpspec run spec + + phpstan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: '**/vendor' + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + - uses: php-actions/composer@v5 + with: + args: --prefer-dist + php_version: 8.0 + - name: PHPStan + uses: php-actions/phpstan@v2 + with: + path: src/ + level: 4 + php_version: 8.0