From 9ed8e9fb2a54f757b6cbba6f299cd1a981789fc9 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Fri, 19 Jan 2024 11:37:12 +0100 Subject: [PATCH] Update CI --- .../workflows/{autoformat.yml => format.yml} | 6 +- .github/workflows/validate.yml | 102 ++++++------------ 2 files changed, 35 insertions(+), 73 deletions(-) rename .github/workflows/{autoformat.yml => format.yml} (90%) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/format.yml similarity index 90% rename from .github/workflows/autoformat.yml rename to .github/workflows/format.yml index 9e91885..20a641d 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/format.yml @@ -17,7 +17,7 @@ jobs: with: coverage: none extensions: mbstring - php-version: 8.1 + php-version: 8.3 - run: composer install --no-interaction --no-progress --no-suggest @@ -27,7 +27,7 @@ jobs: - uses: stefanzweifel/git-auto-commit-action@v4 with: - commit_message: Apply php-cs-fixer changes + commit_message: Normalize composer.json php-cs-fixer: runs-on: ubuntu-latest @@ -40,7 +40,7 @@ jobs: with: coverage: none extensions: mbstring - php-version: 8.1 + php-version: 8.3 - run: composer install --no-interaction --no-progress --no-suggest diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index a7bb7e4..303c1d7 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -6,53 +6,38 @@ on: branches: - "master" -name: "Validate" - jobs: composer-validate: - name: "Composer Validate" - runs-on: ubuntu-latest steps: - - name: "Checkout" - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: "Setup PHP" - uses: shivammathur/setup-php@v2 + - uses: shivammathur/setup-php@v2 with: coverage: none extensions: mbstring - php-version: 8.1 + php-version: 8.3 - - name: "Validate composer.json and composer.lock" - run: composer validate + - run: composer validate static-code-analysis: - name: "Static Code Analysis" - runs-on: ubuntu-latest steps: - - name: "Checkout" - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: "Setup PHP" - uses: shivammathur/setup-php@v2 + - uses: shivammathur/setup-php@v2 with: coverage: none extensions: mbstring - php-version: 8.1 + php-version: 8.3 - - name: "Install locked dependencies with composer" - run: composer install --no-interaction --no-progress + - run: composer install --no-interaction --no-progress - - name: "Run phpstan/phpstan" - run: vendor/bin/phpstan analyse --configuration=phpstan.neon + - run: vendor/bin/phpstan analyse --configuration=phpstan.neon tests: - name: "Tests" - runs-on: ubuntu-latest strategy: @@ -62,41 +47,34 @@ jobs: - 7.4 - 8.0 - 8.1 - + - 8.2 + - 8.3 dependencies: - lowest - locked - highest steps: - - name: "Checkout" - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: "Setup PHP" - uses: shivammathur/setup-php@v2 + - uses: shivammathur/setup-php@v2 with: coverage: none extensions: mbstring php-version: ${{ matrix.php-version }} - - name: "Install lowest dependencies with composer" - if: matrix.dependencies == 'lowest' + - if: matrix.dependencies == 'lowest' run: composer update --prefer-lowest --no-interaction --no-progress - - name: "Install locked dependencies with composer" - if: matrix.dependencies == 'locked' + - if: matrix.dependencies == 'locked' run: composer install --no-interaction --no-progress - - name: "Install highest dependencies with composer" - if: matrix.dependencies == 'highest' + - if: matrix.dependencies == 'highest' run: composer update --no-interaction --no-progress - - name: "Run unit tests with phpunit/phpunit" - run: vendor/bin/phpunit + - run: vendor/bin/phpunit examples: - name: "Examples" - runs-on: ubuntu-latest strategy: @@ -111,64 +89,48 @@ jobs: - polymorphic steps: - - name: "Checkout" - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: "Setup PHP" - uses: shivammathur/setup-php@v2 + - uses: shivammathur/setup-php@v2 with: coverage: none extensions: mbstring - php-version: 8.1 + php-version: 8.3 env: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: "Run the integration tests in each example" - run: cd examples/${{ matrix.example }} && ./test.sh + - run: cd examples/${{ matrix.example }} && ./test.sh code-coverage: - name: "Code Coverage" - runs-on: ubuntu-latest steps: - - name: "Checkout" - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: "Setup PHP" - uses: shivammathur/setup-php@v2 + - uses: shivammathur/setup-php@v2 with: coverage: pcov extensions: mbstring - php-version: 8.1 + php-version: 8.3 - - name: "Install locked dependencies with composer" - run: composer install --no-interaction --no-progress + - run: composer install --no-interaction --no-progress - - name: "Collect code coverage with Xdebug and phpunit/phpunit" - run: vendor/bin/phpunit --coverage-clover=build/logs/clover.xml + - run: vendor/bin/phpunit --coverage-clover=build/logs/clover.xml - - name: "Send code coverage report to codecov.io" - uses: codecov/codecov-action@v2 + - uses: codecov/codecov-action@v2 mutation-tests: - name: "Mutation Tests" - runs-on: ubuntu-latest steps: - - name: "Checkout" - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: "Setup PHP" - uses: shivammathur/setup-php@v2 + - uses: shivammathur/setup-php@v2 with: coverage: xdebug extensions: mbstring - php-version: 8.1 + php-version: 8.3 - - name: "Install locked dependencies with composer" - run: composer install --no-interaction --no-progress + - run: composer install --no-interaction --no-progress - - name: "Run mutation tests with infection/infection" - run: vendor/bin/infection + - run: vendor/bin/infection