From e4387960dc5ed9ea7eec18151bd105643de5789d Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Fri, 17 Dec 2021 22:29:24 +0100 Subject: [PATCH] Update CI workflow --- .github/workflows/ci.yml | 64 +++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d364bd9..54b37c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,46 +1,47 @@ name: CI -on: [ push, pull_request ] +on: [push, pull_request] jobs: tests: name: PHP ${{ matrix.php }} (${{ matrix.dependencies }} deps) runs-on: ubuntu-latest + timeout-minutes: 5 strategy: matrix: - php: [ "7.4", "8.0", "8.1" ] - dependencies: [ "lowest", "locked" ] + php: ["7.4", "8.0", "8.1"] + dependencies: ["lowest", "locked"] env: extensions: mbstring, pcov ini: pcov.directory=., "pcov.exclude=\"~(vendor|tests)~\"" steps: - name: Checkout - uses: actions/checkout@f1d3225b5376a0791fdee5a0e8eac5289355e43a # pin@v2 + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # pin@v2 - name: Setup PHP cache environment id: ext-cache - uses: shivammathur/cache-extensions@8828d749a642ae651470bd7713c2266c82cac102 # pin@v1 + uses: shivammathur/cache-extensions@2e789925e438042ecda2b83f0fd00bbc016da76e # pin@v1 with: php-version: ${{ matrix.php }} extensions: ${{ env.extensions }} key: php-v1 - name: Cache PHP extensions - uses: actions/cache@1c6fb82ebbd610035c324e764e5e74d0e82f8a60 # pin@v2 + uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # pin@v2 with: path: ${{ steps.ext-cache.outputs.dir }} key: ${{ steps.ext-cache.outputs.key }} restore-keys: ${{ steps.ext-cache.outputs.key }} - name: Setup PHP environment - uses: shivammathur/setup-php@ed52ff9a52991475b075a4c2144f7276195e8620 # pin@v2 + uses: shivammathur/setup-php@e2e76ea34f2059c0d66bf5c54ea75610185397f3 # pin@v2 with: php-version: ${{ matrix.php }} extensions: ${{ env.extensions }} ini-values: ${{ env.ini }} coverage: pcov - tools: phpunit:9.5.4, psalm:4.7.1 + tools: phpunit:9.5.10, psalm:4.11.2 - name: Setup problem matchers run: | @@ -52,7 +53,7 @@ jobs: run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache dependencies - uses: actions/cache@1c6fb82ebbd610035c324e764e5e74d0e82f8a60 # pin@v2 + uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # pin@v2 with: path: ${{ steps.composerCache.outputs.dir }} key: ${{ runner.os }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }} @@ -66,7 +67,7 @@ jobs: - name: Cache analysis data id: finishPrepare - uses: actions/cache@1c6fb82ebbd610035c324e764e5e74d0e82f8a60 # pin@v2 + uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # pin@v2 with: path: ~/.cache/psalm key: backend-analysis-${{ matrix.php }}-v1 @@ -80,7 +81,7 @@ jobs: run: psalm --output-format=github --php-version=${{ matrix.php }} - name: Upload coverage results to Codecov - uses: codecov/codecov-action@a1ed4b322b4b38cb846afb5a0ebfa17086917d27 # pin@v1 + uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # pin@v1 with: file: ${{ github.workspace }}/clover.xml flags: backend @@ -92,24 +93,25 @@ jobs: name: Analysis runs-on: ubuntu-latest + timeout-minutes: 5 env: php: "8.0" extensions: mbstring steps: - name: Checkout - uses: actions/checkout@f1d3225b5376a0791fdee5a0e8eac5289355e43a # pin@v2 + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # pin@v2 - name: Setup PHP cache environment id: ext-cache - uses: shivammathur/cache-extensions@8828d749a642ae651470bd7713c2266c82cac102 # pin@v1 + uses: shivammathur/cache-extensions@2e789925e438042ecda2b83f0fd00bbc016da76e # pin@v1 with: php-version: ${{ env.php }} extensions: ${{ env.extensions }} - key: php-analysis-v1 + key: php-v1 - name: Cache PHP extensions - uses: actions/cache@1c6fb82ebbd610035c324e764e5e74d0e82f8a60 # pin@v2 + uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # pin@v2 with: path: ${{ steps.ext-cache.outputs.dir }} key: ${{ steps.ext-cache.outputs.key }} @@ -117,14 +119,14 @@ jobs: - name: Setup PHP environment id: finishPrepare - uses: shivammathur/setup-php@ed52ff9a52991475b075a4c2144f7276195e8620 # pin@v2 + uses: shivammathur/setup-php@e2e76ea34f2059c0d66bf5c54ea75610185397f3 # pin@v2 with: php-version: ${{ env.php }} extensions: ${{ env.extensions }} coverage: none tools: | - composer:2.0.13, composer-normalize:2.13.3, composer-require-checker:3.2.0, - composer-unused:0.7.5, phpcpd:6.0.3, phpmd:2.10.0 + composer:2.1.10, composer-normalize:2.15.0, composer-require-checker:3.3.0, + composer-unused:0.7.7, phpcpd:6.0.3, phpmd:2.10.2 - name: Validate composer.json/composer.lock if: always() && steps.finishPrepare.outcome == 'success' @@ -142,7 +144,7 @@ jobs: - name: Cache dependencies id: composerCache2 if: always() && steps.composerCache1.outcome == 'success' - uses: actions/cache@1c6fb82ebbd610035c324e764e5e74d0e82f8a60 # pin@v2 + uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # pin@v2 with: path: ${{ steps.composerCache1.outputs.dir }} key: ${{ runner.os }}-composer-locked-${{ hashFiles('**/composer.lock') }} @@ -173,33 +175,29 @@ jobs: name: Coding Style & Frontend Analysis runs-on: ubuntu-latest + timeout-minutes: 5 steps: - name: Checkout - uses: actions/checkout@f1d3225b5376a0791fdee5a0e8eac5289355e43a # pin@v2 - - - name: Set up Node.js problem matchers - uses: actions/setup-node@0696555e99b7a8260864ca027af4b004eea59379 # pin@v2 + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # pin@v2 - - name: Cache npm dependencies - uses: actions/cache@1c6fb82ebbd610035c324e764e5e74d0e82f8a60 # pin@v2 + - name: Set up Node.js problem matchers and cache npm dependencies + uses: actions/setup-node@04c56d2f954f1e4c69436aa54cfef261a018f458 # pin@v2 with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: ${{ runner.os }}-node- + cache: 'npm' - name: Install npm dependencies run: npm ci - name: Setup PHP environment - uses: shivammathur/setup-php@ed52ff9a52991475b075a4c2144f7276195e8620 # pin@v2 + uses: shivammathur/setup-php@e2e76ea34f2059c0d66bf5c54ea75610185397f3 # pin@v2 with: coverage: none - tools: php-cs-fixer:3.0.0 + tools: php-cs-fixer:3.2.1 - name: Cache analysis data id: finishPrepare - uses: actions/cache@1c6fb82ebbd610035c324e764e5e74d0e82f8a60 # pin@v2 + uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # pin@v2 with: path: ~/.php-cs-fixer key: coding-style @@ -215,7 +213,7 @@ jobs: if: > always() && steps.finishPrepare.outcome == 'success' && github.event_name == 'pull_request' - uses: reviewdog/action-suggester@5d5b9f8c693e036796f828e47886bd10d368c273 # pin@v1 + uses: reviewdog/action-suggester@1b18099af6c3c023256eb87a27aab5623e9b934d # pin@v1 with: tool_name: ESLint fail_on_error: 'true' @@ -233,7 +231,7 @@ jobs: if: > always() && steps.finishPrepare.outcome == 'success' && github.event_name == 'pull_request' - uses: reviewdog/action-suggester@5d5b9f8c693e036796f828e47886bd10d368c273 # pin@v1 + uses: reviewdog/action-suggester@1b18099af6c3c023256eb87a27aab5623e9b934d # pin@v1 with: tool_name: PHP-CS-Fixer fail_on_error: 'true'