From f5c18b01e1a7bc6be9b6ab606214591bed58cce0 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sun, 19 Sep 2021 05:23:03 +0200 Subject: [PATCH] Used CI from `laminas/` to avoid repeated effort Note: this removes BC checks, which are currently not running for PHP 8.x Ref: https://github.com/laminas/laminas-ci-matrix-action/pull/59 Ref: https://github.com/laminas/laminas-ci-matrix-action/issues/60 Ref: https://github.com/Roave/BackwardCompatibilityCheck/issues/283 Ref: https://github.com/Roave/BetterReflection/issues/701 --- .github/workflows/backwards-compatibility.yml | 58 ------------------ .github/workflows/benchmarks.yml | 56 ----------------- .github/workflows/coding-standards.yml | 56 ----------------- ...scripts.yml => continuous-integration.yml} | 30 +++++++++- .github/workflows/mutation-tests.yml | 60 ------------------- .github/workflows/phpunit.yml | 58 ------------------ .github/workflows/psalm.yml | 56 ----------------- 7 files changed, 29 insertions(+), 345 deletions(-) delete mode 100644 .github/workflows/backwards-compatibility.yml delete mode 100644 .github/workflows/benchmarks.yml delete mode 100644 .github/workflows/coding-standards.yml rename .github/workflows/{demo-scripts.yml => continuous-integration.yml} (63%) delete mode 100644 .github/workflows/mutation-tests.yml delete mode 100644 .github/workflows/phpunit.yml delete mode 100644 .github/workflows/psalm.yml diff --git a/.github/workflows/backwards-compatibility.yml b/.github/workflows/backwards-compatibility.yml deleted file mode 100644 index bec07b46..00000000 --- a/.github/workflows/backwards-compatibility.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: "Check Backwards Compatibility" - -on: - pull_request: - push: - -jobs: - coding-standards: - name: "Check Backwards Compatibility" - - runs-on: ${{ matrix.operating-system }} - - strategy: - matrix: - dependencies: - - "locked" - php-version: - - "7.4" - operating-system: - - "ubuntu-latest" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - with: - fetch-depth: 0 - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "pcov" - php-version: "${{ matrix.php-version }}" - ini-values: memory_limit=-1 - tools: composer:v2, cs2pr - - - name: "Cache dependencies" - uses: "actions/cache@v2" - with: - path: | - ~/.composer/cache - vendor - key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress --no-suggest" - - - name: "Install locked dependencies" - if: ${{ matrix.dependencies == 'locked' }} - run: "composer install --no-interaction --no-progress --no-suggest" - - - name: "Roave Backward Compatibility Check" - run: "vendor/bin/roave-backward-compatibility-check" diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml deleted file mode 100644 index d003acf3..00000000 --- a/.github/workflows/benchmarks.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: "Benchmarks" - -on: - pull_request: - push: - -jobs: - benchmarks: - name: "Run benchmarks" - - runs-on: ${{ matrix.operating-system }} - - strategy: - matrix: - dependencies: - - "locked" - php-version: - - "7.4" - operating-system: - - "ubuntu-latest" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "pcov" - php-version: "${{ matrix.php-version }}" - ini-values: memory_limit=-1 - tools: composer:v2, cs2pr - - - name: "Cache dependencies" - uses: "actions/cache@v2" - with: - path: | - ~/.composer/cache - vendor - key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress --no-suggest" - - - name: "Install locked dependencies" - if: ${{ matrix.dependencies == 'locked' }} - run: "composer install --no-interaction --no-progress --no-suggest" - - - name: "PhpBench" - run: "vendor/bin/phpbench run --report=aggregate --revs=5 --iterations=5 --warmup=3" diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml deleted file mode 100644 index 061f498f..00000000 --- a/.github/workflows/coding-standards.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: "Check Coding Standards" - -on: - pull_request: - push: - -jobs: - coding-standards: - name: "Check Coding Standards" - - runs-on: ${{ matrix.operating-system }} - - strategy: - matrix: - dependencies: - - "locked" - php-version: - - "7.4" - operating-system: - - "ubuntu-latest" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "pcov" - php-version: "${{ matrix.php-version }}" - ini-values: memory_limit=-1 - tools: composer:v2, cs2pr - - - name: "Cache dependencies" - uses: "actions/cache@v2" - with: - path: | - ~/.composer/cache - vendor - key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress --no-suggest" - - - name: "Install locked dependencies" - if: ${{ matrix.dependencies == 'locked' }} - run: "composer install --no-interaction --no-progress --no-suggest" - - - name: "Coding Standard" - run: "vendor/bin/phpcs -q --report=checkstyle | cs2pr" diff --git a/.github/workflows/demo-scripts.yml b/.github/workflows/continuous-integration.yml similarity index 63% rename from .github/workflows/demo-scripts.yml rename to .github/workflows/continuous-integration.yml index ec8aef8e..503c500e 100644 --- a/.github/workflows/demo-scripts.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,10 +1,38 @@ -name: "Check Demo Scripts" +# See https://github.com/laminas/laminas-continuous-integration-action +# Generates a job matrix based on current dependencies and supported version +# ranges, then runs all those jobs +name: "Continuous Integration" on: pull_request: push: jobs: + matrix: + name: Generate job matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.matrix.outputs.matrix }} + steps: + - name: Gather CI configuration + id: matrix + uses: laminas/laminas-ci-matrix-action@1.10.0 + + qa: + name: QA Checks + needs: [ matrix ] + runs-on: ${{ matrix.operatingSystem }} + strategy: + fail-fast: false + matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }} + steps: + - name: ${{ matrix.name }} + uses: laminas/laminas-continuous-integration-action@1.12.0 + env: + "GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }} + with: + job: ${{ matrix.job }} + demo-scripts: name: "Check Demo Scripts" diff --git a/.github/workflows/mutation-tests.yml b/.github/workflows/mutation-tests.yml deleted file mode 100644 index fc59f524..00000000 --- a/.github/workflows/mutation-tests.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: "Mutation tests" - -on: - pull_request: - push: - -jobs: - mutation-tests: - name: "Mutation tests" - - runs-on: ${{ matrix.operating-system }} - - strategy: - matrix: - dependencies: - - "locked" - php-version: - - "7.4" - operating-system: - - "ubuntu-latest" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "pcov" - php-version: "${{ matrix.php-version }}" - ini-values: memory_limit=-1 - tools: composer:v2, cs2pr - - - name: "Cache dependencies" - uses: "actions/cache@v2" - with: - path: | - ~/.composer/cache - vendor - key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress --no-suggest" - - - name: "Install locked dependencies" - if: ${{ matrix.dependencies == 'locked' }} - run: "composer install --no-interaction --no-progress --no-suggest" - - - name: "Infection" - run: "./vendor/bin/infection" - env: - INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }} - STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} - diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml deleted file mode 100644 index 022192dc..00000000 --- a/.github/workflows/phpunit.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: "PHPUnit tests" - -on: - pull_request: - push: - -jobs: - phpunit: - name: "PHPUnit tests" - - runs-on: ${{ matrix.operating-system }} - - strategy: - matrix: - dependencies: - - "lowest" - - "highest" - - "locked" - php-version: - - "7.4" - operating-system: - - "ubuntu-latest" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "pcov" - php-version: "${{ matrix.php-version }}" - ini-values: memory_limit=-1 - tools: composer:v2, cs2pr - - - name: "Cache dependencies" - uses: "actions/cache@v2" - with: - path: | - ~/.composer/cache - vendor - key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress --no-suggest" - - - name: "Install locked dependencies" - if: ${{ matrix.dependencies == 'locked' }} - run: "composer install --no-interaction --no-progress --no-suggest" - - - name: "Tests" - run: "vendor/bin/phpunit" diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml deleted file mode 100644 index 8356e723..00000000 --- a/.github/workflows/psalm.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: "Static Analysis by Psalm" - -on: - pull_request: - push: - -jobs: - static-analysis-psalm: - name: "Static Analysis by Psalm" - - runs-on: ${{ matrix.operating-system }} - - strategy: - matrix: - dependencies: - - "locked" - php-version: - - "7.4" - operating-system: - - "ubuntu-latest" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "pcov" - php-version: "${{ matrix.php-version }}" - ini-values: memory_limit=-1 - tools: composer:v2, cs2pr - - - name: "Cache dependencies" - uses: "actions/cache@v2" - with: - path: | - ~/.composer/cache - vendor - key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress --no-suggest" - - - name: "Install locked dependencies" - if: ${{ matrix.dependencies == 'locked' }} - run: "composer install --no-interaction --no-progress --no-suggest" - - - name: "psalm" - run: "vendor/bin/psalm --output-format=github --shepherd --stats"