From 9122c6d963b596c0bef2cbf8382efa5c91f80024 Mon Sep 17 00:00:00 2001 From: Alies Lapatsin Date: Sun, 15 Dec 2024 12:21:05 +0100 Subject: [PATCH 1/8] Update dependencies --- .github/workflows/format_php.yml | 2 +- .github/workflows/psalm.yml | 2 +- .github/workflows/run-tests.yml | 14 +++++++------- composer.json | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/format_php.yml b/.github/workflows/format_php.yml index 0a9fec3..df80bec 100644 --- a/.github/workflows/format_php.yml +++ b/.github/workflows/format_php.yml @@ -24,7 +24,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.2 + php-version: 8.4 coverage: none tools: cs2pr env: diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 66a71a9..71d383f 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -16,7 +16,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: '8.4' coverage: none - name: Cache composer dependencies diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b1a8fa7..245b69f 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -8,12 +8,12 @@ jobs: strategy: fail-fast: true matrix: - php: [ 8.3, 8.2 ] - laravel: [ 10.* ] + php: [ 8.4, 8.3, 8.2, 8.1 ] + laravel: [ 10.*, 11.* ] dependency-version: [ prefer-stable ] include: - - laravel: 10.* - testbench: 8.* + - laravel: 11.* + testbench: 9.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} @@ -35,7 +35,7 @@ jobs: - name: Install dependencies run: | composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_4_LICENSE_KEY }}" - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench-core:${{ matrix.testbench }}" --no-interaction --no-update composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction env: COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} @@ -54,14 +54,14 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 - name: Cache yarn dependencies uses: actions/cache@v4 id: npm-node_modules-cache with: path: node_modules - key: npm-${{ hashFiles('package.json') }}-node-20 + key: npm-${{ hashFiles('package.json') }}-node-22 - name: Compile assets run: npm install && npm run prod diff --git a/composer.json b/composer.json index 7956484..d29a6b1 100644 --- a/composer.json +++ b/composer.json @@ -12,12 +12,12 @@ ], "require": { "php": "^8.1", - "laravel/nova": "^4.20" + "laravel/nova": "^4.20 || ^5.0" }, "require-dev": { "interaction-design-foundation/coding-standard": "^0.3.0", - "orchestra/testbench": "^8.3", - "phpunit/phpunit": "^10.5 || ^11.0", + "testbench-core": "^9.7", + "phpunit/phpunit": "^11.0", "vimeo/psalm": "^5.22" }, "repositories": [ From 0870fdd99130ad68222bff774f12a68bac3088b8 Mon Sep 17 00:00:00 2001 From: Alies Lapatsin Date: Sun, 15 Dec 2024 12:28:50 +0100 Subject: [PATCH 2/8] Update CI/CD dependencies --- .github/workflows/format_php.yml | 4 ++-- .github/workflows/psalm.yml | 3 +++ .github/workflows/run-tests.yml | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/format_php.yml b/.github/workflows/format_php.yml index df80bec..c4df741 100644 --- a/.github/workflows/format_php.yml +++ b/.github/workflows/format_php.yml @@ -18,8 +18,8 @@ jobs: ref: ${{ github.head_ref }} # mtime needs to be restored for PHP-CS-Fixer cache to work correctly - - name: Restore mtimes - uses: weirdan/git-restore-mtime-action@master + - name: Restore timestamps + uses: chetan/git-restore-mtime-action@v2 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 71d383f..bfb41eb 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -30,5 +30,8 @@ jobs: composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_4_LICENSE_KEY }}" composer install -n --prefer-dist + - name: Restore timestamps + uses: chetan/git-restore-mtime-action@v2 + - name: Run Psalm run: ./vendor/bin/psalm --shepherd diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 245b69f..0194de1 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -8,8 +8,8 @@ jobs: strategy: fail-fast: true matrix: - php: [ 8.4, 8.3, 8.2, 8.1 ] - laravel: [ 10.*, 11.* ] + php: [ 8.4, 8.3, 8.2 ] + laravel: [ 11.* ] dependency-version: [ prefer-stable ] include: - laravel: 11.* @@ -35,7 +35,7 @@ jobs: - name: Install dependencies run: | composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_4_LICENSE_KEY }}" - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench-core:${{ matrix.testbench }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction env: COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} From 30875bbe901b3f32527dc5f52dd4528798037ce4 Mon Sep 17 00:00:00 2001 From: Alies Lapatsin Date: Sun, 15 Dec 2024 12:29:45 +0100 Subject: [PATCH 3/8] Fix vendor name --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d29a6b1..6552cc4 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ }, "require-dev": { "interaction-design-foundation/coding-standard": "^0.3.0", - "testbench-core": "^9.7", + "orchestra/testbench-core": "^9.7", "phpunit/phpunit": "^11.0", "vimeo/psalm": "^5.22" }, From 1e2db2ae1c7d9d059d73d8b4fac34db486415967 Mon Sep 17 00:00:00 2001 From: Alies Lapatsin Date: Sun, 15 Dec 2024 12:45:26 +0100 Subject: [PATCH 4/8] Fix CI --- .github/workflows/format_php.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/format_php.yml b/.github/workflows/format_php.yml index c4df741..321c77c 100644 --- a/.github/workflows/format_php.yml +++ b/.github/workflows/format_php.yml @@ -43,17 +43,11 @@ jobs: restore-keys: | ${{ runner.os }}-composer- - - name: Install composer dependencies -- step 1 - run: 'composer install --working-dir=tools/php-cs-fixer --no-interaction --no-progress --no-scripts' - - - name: Install composer dependencies -- step 2 - run: 'composer install --working-dir=tools/phpcs --no-interaction --no-progress --no-scripts' - - name: Retrieve PHP-CS-Fixer’s cache uses: actions/cache@v4 with: path: .php-cs-fixer.cache - key: ${{ runner.os }}-php-cs-fixer-${{ hashFiles('.php-cs-fixer.php', '.phpcs/**/**') }} + key: ${{ runner.os }}-php-cs-fixer-${{ hashFiles('.php-cs-fixer.php') }} restore-keys: | ${{ runner.os }}-php-cs-fixer- @@ -73,7 +67,7 @@ jobs: - name: Fix detected PHP coding style issues (if any) if: ${{ steps.lint_php.outcome == 'failure' }} id: fix_php - run: composer php:fix + run: composer cs:check continue-on-error: true - name: Commit PHP code-style fixes (if any) From c4d92a4b0abf99ce605609cc35f6f5fd1f59484c Mon Sep 17 00:00:00 2001 From: Alies Lapatsin Date: Sun, 15 Dec 2024 12:47:17 +0100 Subject: [PATCH 5/8] Do not run Psalm on unsupported PHP 8.4 --- .github/workflows/psalm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index bfb41eb..5f66043 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -16,7 +16,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.3' coverage: none - name: Cache composer dependencies From 1e3f984db5fcc92e2641e804fb8b407d8854b553 Mon Sep 17 00:00:00 2001 From: Alies Lapatsin Date: Sun, 15 Dec 2024 12:48:10 +0100 Subject: [PATCH 6/8] Do not run Psalm on unsupported PHP 8.4 --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 0194de1..836f603 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: true matrix: - php: [ 8.4, 8.3, 8.2 ] + php: [ 8.3, 8.2 ] laravel: [ 11.* ] dependency-version: [ prefer-stable ] include: From 95f5eea69155e29aa9edff050f2e5f49e5591523 Mon Sep 17 00:00:00 2001 From: Alies Lapatsin Date: Sun, 15 Dec 2024 12:59:02 +0100 Subject: [PATCH 7/8] Use cpx to run Psalm (avoid conflicts) --- composer.json | 9 +++++---- psalm-baseline.xml | 8 +------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 6552cc4..3f9a1d2 100644 --- a/composer.json +++ b/composer.json @@ -16,9 +16,8 @@ }, "require-dev": { "interaction-design-foundation/coding-standard": "^0.3.0", - "orchestra/testbench-core": "^9.7", - "phpunit/phpunit": "^11.0", - "vimeo/psalm": "^5.22" + "orchestra/testbench-core": "^8.30 || ^9.7", + "phpunit/phpunit": "^11.0" }, "repositories": [ { @@ -59,7 +58,9 @@ "cs": "@cs:fix", "cs:check": "phpcs -p -s --colors --report-full --report-summary", "cs:fix": "phpcbf -p --colors", - "psalm": "vendor/bin/psalm", + "psalm": "cpx psalm", + "sa": "@psalm", + "sa:bl": "cpx psalm --set-baseline=psalm-baseline.xml --long-progress --threads=1", "test": "phpunit --colors=always" } } diff --git a/psalm-baseline.xml b/psalm-baseline.xml index f6a6c06..5c064bb 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,8 +1,2 @@ - - - - - - - + From eaaa631af7079229b051934116d7a84f15179b9a Mon Sep 17 00:00:00 2001 From: Alies Lapatsin Date: Sun, 15 Dec 2024 13:01:10 +0100 Subject: [PATCH 8/8] Use cpx on CI/CD --- .github/workflows/psalm.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 5f66043..1489b61 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -33,5 +33,7 @@ jobs: - name: Restore timestamps uses: chetan/git-restore-mtime-action@v2 + - run: composer global require cpx/cpx + - name: Run Psalm - run: ./vendor/bin/psalm --shepherd + run: composer psalm -- --shepherd