Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add parallel-lint to lint downgraded source #16

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,8 @@ jobs:
- name: Downgrade src
run: php bin/transform-source ${{ env.TARGET_PHP_VERSION_ID }}

- name: Setup PHP ${{ env.TARGET_PHP_VERSION }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.TARGET_PHP_VERSION }}
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.RELEASE_TOKEN }}
- name: Run lint on src
run: vendor/bin/parallel-lint src --colors --show-deprecated

- name: Get tag for downgraded release
id: tag-downgraded
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/test-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
- '**.php'
- 'phpunit.dist.xml'

env:
TARGET_PHP_VERSION: '7.4'
TARGET_PHP_VERSION_ID: 70400

jobs:
extension-tests:
name: PHPUnit Extension Tests [PHP ${{ matrix.php-version }}]
Expand Down Expand Up @@ -55,5 +59,11 @@ jobs:
- name: Install dependencies
run: composer update --ansi

- name: Downgrade src
run: php bin/transform-source ${{ env.TARGET_PHP_VERSION_ID }}

- name: Run lint on src
run: vendor/bin/parallel-lint src --colors --show-deprecated
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems you do not check on PHP 7.4. Is it intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's my original intention. But composer update fails: https://github.com/CodeIgniter/phpstan-codeigniter/actions/runs/6873219405/job/18692938215

If I will reinstall PHP for PHP 7.4, I will first remove PHPUnit 10 to run lint then reinstall again PHP 8.1 to run tests. It's tedious. Unless you have another flow in mind?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, frankly, I feel it is tedious to downgrade.
I want to drop PHP 7.4 and 8.0!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This downgrading is just a hack for now while v4.5 is not yet out.


- name: Run Extension Tests
run: vendor/bin/phpunit --no-coverage
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"codeigniter4/shield": "^1.0@beta",
"friendsofphp/php-cs-fixer": "^3.20",
"nexusphp/cs-config": "^3.12",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan-deprecation-rules": "^1.1",
"phpstan/phpstan-phpunit": "^1.3",
Expand Down