From ad47291db6c31404fd8c9bfb40eaa87c603c08e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Apr 2022 12:08:18 +0000 Subject: [PATCH 1/9] Bump actions/checkout from 2 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/analyze.yml | 2 +- .github/workflows/compare.yml | 2 +- .github/workflows/deduplicate.yml | 2 +- .github/workflows/inspect.yml | 2 +- .github/workflows/test.yml | 2 +- .github/workflows/unused.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index f3c02b4..7f9616b 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -32,7 +32,7 @@ jobs: php-versions: ['7.4', '8.0', '8.1'] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/compare.yml b/.github/workflows/compare.yml index c6b5e9b..9897358 100644 --- a/.github/workflows/compare.yml +++ b/.github/workflows/compare.yml @@ -14,7 +14,7 @@ jobs: name: Compare for Backwards Compatibility runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 diff --git a/.github/workflows/deduplicate.yml b/.github/workflows/deduplicate.yml index 827bbbc..c418474 100644 --- a/.github/workflows/deduplicate.yml +++ b/.github/workflows/deduplicate.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/inspect.yml b/.github/workflows/inspect.yml index 23440fe..f3dba2f 100644 --- a/.github/workflows/inspect.yml +++ b/.github/workflows/inspect.yml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 582206a..c4a5e28 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/unused.yml b/.github/workflows/unused.yml index 4d2ee36..bb1d49b 100644 --- a/.github/workflows/unused.yml +++ b/.github/workflows/unused.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 From f60c28c673d73368256db25da7331431c93ab9a0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 08:24:41 +0000 Subject: [PATCH 2/9] Bump actions/cache from 2 to 3.0.1 Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.0.1. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v2...v3.0.1) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/analyze.yml | 4 ++-- .github/workflows/inspect.yml | 4 ++-- .github/workflows/test.yml | 2 +- .github/workflows/unused.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 7f9616b..bdff521 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -51,7 +51,7 @@ jobs: run: mkdir -p ${{ steps.composer-cache.outputs.dir }} - name: Cache composer dependencies - uses: actions/cache@v2 + uses: actions/cache@v3.0.1 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} @@ -61,7 +61,7 @@ jobs: run: mkdir -p build/phpstan - name: Cache PHPStan results - uses: actions/cache@v2 + uses: actions/cache@v3.0.1 with: path: build/phpstan key: ${{ runner.os }}-phpstan-${{ github.sha }} diff --git a/.github/workflows/inspect.yml b/.github/workflows/inspect.yml index f3dba2f..67bdca9 100644 --- a/.github/workflows/inspect.yml +++ b/.github/workflows/inspect.yml @@ -47,7 +47,7 @@ jobs: run: mkdir -p ${{ steps.composer-cache.outputs.dir }} - name: Cache composer dependencies - uses: actions/cache@v2 + uses: actions/cache@v3.0.1 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} @@ -57,7 +57,7 @@ jobs: run: mkdir -p build/ - name: Cache Deptrac results - uses: actions/cache@v2 + uses: actions/cache@v3.0.1 with: path: build key: ${{ runner.os }}-deptrac-${{ github.sha }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c4a5e28..2b608a4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,7 +39,7 @@ jobs: run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v2 + uses: actions/cache@v3.0.1 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} diff --git a/.github/workflows/unused.yml b/.github/workflows/unused.yml index bb1d49b..46c059b 100644 --- a/.github/workflows/unused.yml +++ b/.github/workflows/unused.yml @@ -40,7 +40,7 @@ jobs: run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v2 + uses: actions/cache@v3.0.1 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} From 2416fb386f2ab5c80be51f5732cbd1d250225318 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 25 Apr 2022 08:42:12 +0900 Subject: [PATCH 3/9] chore: remove step "Run comparison (limited)" --- .github/workflows/compare.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/compare.yml b/.github/workflows/compare.yml index 9897358..98697a3 100644 --- a/.github/workflows/compare.yml +++ b/.github/workflows/compare.yml @@ -18,10 +18,6 @@ jobs: with: fetch-depth: 0 - - name: Run comparison (limited) - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} - uses: docker://nyholm/roave-bc-check-ga - - name: Run comparison (authenticated) if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} uses: docker://nyholm/roave-bc-check-ga From 26fcd84979520405f93f05fd09c4110fb834a937 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 25 Apr 2022 08:46:48 +0900 Subject: [PATCH 4/9] chore: update workflows/unused.yml --- .github/workflows/unused.yml | 37 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/unused.yml b/.github/workflows/unused.yml index 46c059b..c3b23d9 100644 --- a/.github/workflows/unused.yml +++ b/.github/workflows/unused.yml @@ -5,23 +5,25 @@ name: Unused on: pull_request: branches: - - 'develop' + - develop paths: - - 'src/**' - - 'tests/**' + - '**.php' + - 'composer.*' - '.github/workflows/unused.yml' push: branches: - - 'develop' + - develop paths: - - 'src/**' - - 'tests/**' + - '**.php' + - 'composer.*' - '.github/workflows/unused.yml' jobs: build: name: Unused Package Detection runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + steps: - name: Checkout uses: actions/checkout@v3 @@ -32,6 +34,7 @@ jobs: php-version: '8.0' tools: composer, composer-unused extensions: intl, json, mbstring, xml + coverage: none env: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -40,21 +43,19 @@ jobs: run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v3.0.1 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - - name: Install dependencies (limited) - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} - run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - - - name: Install dependencies (authenticated) - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} - run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - env: - COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} + - name: Install dependencies + run: | + if [ -f composer.lock ]; then + composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader + else + composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader + fi - name: Detect unused packages - run: composer-unused -vvv --profile --ansi --no-interaction --no-progress --excludePackage=php + run: composer-unused -vvv --output-format=github --ansi --no-interaction --no-progress From 11d155f3d9520772a14f1ee45ab63fba9ff7dd0e Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 25 Apr 2022 08:51:39 +0900 Subject: [PATCH 5/9] chore: remove step "Run comparison (limited)" --- .github/workflows/analyze.yml | 4 ---- .github/workflows/inspect.yml | 4 ---- .github/workflows/test.yml | 4 ---- 3 files changed, 12 deletions(-) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index bdff521..475cf7f 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -67,10 +67,6 @@ jobs: key: ${{ runner.os }}-phpstan-${{ github.sha }} restore-keys: ${{ runner.os }}-phpstan- - - name: Install dependencies (limited) - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} - run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - - name: Install dependencies (authenticated) if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader diff --git a/.github/workflows/inspect.yml b/.github/workflows/inspect.yml index 67bdca9..a6fa880 100644 --- a/.github/workflows/inspect.yml +++ b/.github/workflows/inspect.yml @@ -63,10 +63,6 @@ jobs: key: ${{ runner.os }}-deptrac-${{ github.sha }} restore-keys: ${{ runner.os }}-deptrac- - - name: Install dependencies (limited) - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} - run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - - name: Install dependencies (authenticated) if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b608a4..3c1a6bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,10 +45,6 @@ jobs: key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} restore-keys: ${{ runner.os }}-composer- - - name: Install dependencies (limited) - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} - run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - - name: Install dependencies (authenticated) if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader From c62ed2a98a42d8a11e6450a2d09031bd1a2fe43f Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 25 Apr 2022 08:56:54 +0900 Subject: [PATCH 6/9] chore: install new deptrac.yml --- .../workflows/{inspect.yml => deptrac.yml} | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) rename .github/workflows/{inspect.yml => deptrac.yml} (56%) diff --git a/.github/workflows/inspect.yml b/.github/workflows/deptrac.yml similarity index 56% rename from .github/workflows/inspect.yml rename to .github/workflows/deptrac.yml index a6fa880..441c74d 100644 --- a/.github/workflows/inspect.yml +++ b/.github/workflows/deptrac.yml @@ -1,41 +1,40 @@ -# When a PR is opened or a push is made, perform an -# architectural inspection on the code using Deptrac. name: Deptrac on: pull_request: branches: - - 'develop' + - develop paths: - - 'src/**' - - 'tests/**' - - 'composer.**' + - '**.php' + - 'composer.*' - 'depfile.yaml' - - '.github/workflows/inspect.yml' + - '.github/workflows/deptrac.yml' push: branches: - - 'develop' + - develop paths: - - 'src/**' - - 'tests/**' - - 'composer.**' + - '**.php' + - 'composer.*' - 'depfile.yaml' - - '.github/workflows/inspect.yml' + - '.github/workflows/deptrac.yml' jobs: build: - name: Architectural Inspection + name: Dependency Tracing runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + steps: - name: Checkout uses: actions/checkout@v3 - - name: Setup PHP + - name: Set up PHP uses: shivammathur/setup-php@v2 with: php-version: '8.0' - tools: composer, pecl, phive + tools: phive extensions: intl, json, mbstring, xml + coverage: none env: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -43,33 +42,32 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - name: Create composer cache directory - run: mkdir -p ${{ steps.composer-cache.outputs.dir }} - - name: Cache composer dependencies - uses: actions/cache@v3.0.1 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - name: Create Deptrac cache directory run: mkdir -p build/ - name: Cache Deptrac results - uses: actions/cache@v3.0.1 + uses: actions/cache@v3 with: path: build key: ${{ runner.os }}-deptrac-${{ github.sha }} restore-keys: ${{ runner.os }}-deptrac- - - name: Install dependencies (authenticated) - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} - run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - env: - COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} + - name: Install dependencies + run: | + if [ -f composer.lock ]; then + composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader + else + composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader + fi - - name: Run architectural inspection + - name: Trace dependencies run: | sudo phive --no-progress install --global --trust-gpg-keys B8F640134AB1782E,A98E898BB53EB748 qossmic/deptrac deptrac analyze --cache-file=build/deptrac.cache From 9cffa7a6ed51329e1e99d5ace33e30f7ac7b6a4b Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 25 Apr 2022 08:59:14 +0900 Subject: [PATCH 7/9] chore: install new phpcpd.yml --- .github/workflows/deduplicate.yml | 39 ------------------------------- .github/workflows/phpcpd.yml | 36 ++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/deduplicate.yml create mode 100644 .github/workflows/phpcpd.yml diff --git a/.github/workflows/deduplicate.yml b/.github/workflows/deduplicate.yml deleted file mode 100644 index c418474..0000000 --- a/.github/workflows/deduplicate.yml +++ /dev/null @@ -1,39 +0,0 @@ -# When a PR is opened or a push is made, check code -# for duplication with PHP Copy/Paste Detector. -name: PHPCPD - -on: - pull_request: - branches: - - 'develop' - paths: - - 'app/**' - - 'src/**' - - 'tests/**' - - '.github/workflows/deduplicate.yml' - push: - branches: - - 'develop' - paths: - - 'app/**' - - 'src/**' - - 'tests/**' - - '.github/workflows/deduplicate.yml' - -jobs: - build: - name: Duplicate Code Detection - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.0' - tools: phpcpd - extensions: dom, mbstring - - - name: Detect code duplication - run: phpcpd app/ src/ tests/ diff --git a/.github/workflows/phpcpd.yml b/.github/workflows/phpcpd.yml new file mode 100644 index 0000000..d6a877d --- /dev/null +++ b/.github/workflows/phpcpd.yml @@ -0,0 +1,36 @@ +name: PHPCPD + +on: + pull_request: + branches: + - develop + paths: + - '**.php' + - '.github/workflows/phpcpd.yml' + push: + branches: + - develop + paths: + - '**.php' + - '.github/workflows/phpcpd.yml' + +jobs: + build: + name: Code Copy-Paste Detection + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + tools: phpcpd + extensions: dom, mbstring + coverage: none + + - name: Detect duplicate code + run: phpcpd src/ tests/ From 037a01efca5b894e65733f5d176130f4aa5870c7 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 25 Apr 2022 09:02:43 +0900 Subject: [PATCH 8/9] chore: install new phpunit.yml --- .github/workflows/{test.yml => phpunit.yml} | 46 +++++++++++---------- 1 file changed, 25 insertions(+), 21 deletions(-) rename .github/workflows/{test.yml => phpunit.yml} (69%) diff --git a/.github/workflows/test.yml b/.github/workflows/phpunit.yml similarity index 69% rename from .github/workflows/test.yml rename to .github/workflows/phpunit.yml index 3c1a6bd..c875e33 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/phpunit.yml @@ -4,32 +4,39 @@ on: pull_request: branches: - develop + paths: + - '**.php' + - 'composer.*' + - 'phpunit*' + - '.github/workflows/phpunit.yml' push: branches: - develop + paths: + - '**.php' + - 'composer.*' + - 'phpunit*' + - '.github/workflows/phpunit.yml' jobs: main: name: PHP ${{ matrix.php-versions }} Unit Tests - + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" strategy: matrix: php-versions: ['7.4', '8.0', '8.1'] - runs-on: ubuntu-latest - - if: "!contains(github.event.head_commit.message, '[ci skip]')" - steps: - name: Checkout uses: actions/checkout@v3 - - name: Setup PHP, with composer and extensions + - name: Set up PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - tools: composer, infection, pecl, phive, phpunit - extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3 + tools: composer, phive, phpunit + extensions: intl, json, mbstring, gd, xdebug, xml, sqlite3 coverage: xdebug env: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -39,17 +46,19 @@ jobs: run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v3.0.1 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - - name: Install dependencies (authenticated) - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} - run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - env: - COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} + - name: Install dependencies + run: | + if [ -f composer.lock ]; then + composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader + else + composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader + fi - name: Test with PHPUnit run: vendor/bin/phpunit --verbose --coverage-text @@ -57,12 +66,6 @@ jobs: TERM: xterm-256color TACHYCARDIA_MONITOR_GA: enabled - - if: matrix.php-versions == '8.0' - name: Mutate with Infection - run: | - git fetch --depth=1 origin $GITHUB_BASE_REF - infection --threads=2 --skip-initial-tests --coverage=build/phpunit --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-filter=AM --logger-github --ignore-msi-with-no-mutations - - if: matrix.php-versions == '8.0' name: Run Coveralls continue-on-error: true @@ -81,6 +84,7 @@ jobs: steps: - name: Upload Coveralls results uses: coverallsapp/github-action@master + continue-on-error: true with: github-token: ${{ secrets.GITHUB_TOKEN }} parallel-finished: true From 0ee6934e83366ae0659e111888a760ba3b087a44 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 25 Apr 2022 09:04:46 +0900 Subject: [PATCH 9/9] chore: install new phpstan.yml --- .../workflows/{analyze.yml => phpstan.yml} | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) rename .github/workflows/{analyze.yml => phpstan.yml} (57%) diff --git a/.github/workflows/analyze.yml b/.github/workflows/phpstan.yml similarity index 57% rename from .github/workflows/analyze.yml rename to .github/workflows/phpstan.yml index 475cf7f..6bdd00f 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/phpstan.yml @@ -1,35 +1,33 @@ -# When a PR is opened or a push is made, perform -# a static analysis check on the code using PHPStan. name: PHPStan on: pull_request: branches: - - 'develop' + - develop paths: - - 'src/**' - - 'tests/**' - - 'composer.**' + - '**.php' + - 'composer.*' - 'phpstan*' - - '.github/workflows/analyze.yml' + - '.github/workflows/phpstan.yml' push: branches: - - 'develop' + - develop paths: - - 'src/**' - - 'tests/**' - - 'composer.**' + - '**.php' + - 'composer.*' - 'phpstan*' - - '.github/workflows/analyze.yml' + - '.github/workflows/phpstan.yml' jobs: build: name: PHP ${{ matrix.php-versions }} Static Analysis runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" strategy: fail-fast: false matrix: php-versions: ['7.4', '8.0', '8.1'] + steps: - name: Checkout uses: actions/checkout@v3 @@ -38,8 +36,9 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - tools: composer, pecl, phpunit - extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3 + tools: phpstan, phpunit + extensions: intl, json, mbstring, xml + coverage: none env: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -47,31 +46,30 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - name: Create composer cache directory - run: mkdir -p ${{ steps.composer-cache.outputs.dir }} - - name: Cache composer dependencies - uses: actions/cache@v3.0.1 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - name: Create PHPStan cache directory run: mkdir -p build/phpstan - name: Cache PHPStan results - uses: actions/cache@v3.0.1 + uses: actions/cache@v3 with: path: build/phpstan key: ${{ runner.os }}-phpstan-${{ github.sha }} restore-keys: ${{ runner.os }}-phpstan- - - name: Install dependencies (authenticated) - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} - run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader - env: - COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} + - name: Install dependencies + run: | + if [ -f composer.lock ]; then + composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader + else + composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader + fi - name: Run static analysis run: vendor/bin/phpstan analyze