Skip to content

Commit

Permalink
Merge pull request #1 from LycheeOrg/more-rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Dec 7, 2022
1 parent 14e5e57 commit 0c26789
Show file tree
Hide file tree
Showing 6 changed files with 1,068 additions and 3,192 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ trim_trailing_whitespace = false
[*.js]
indent_style = tab
indent_size = 4

[*.yml]
indent_style = space
indent_size = 2
120 changes: 120 additions & 0 deletions .github/workflows/test-impact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Test Impact

# Run this workflow every time a new commit pushed to your repository
on:
push:
paths-ignore:
- '**/*.md'
pull_request:
paths-ignore:
- '**/*.md'
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
kill_previous:
name: 0️⃣ Kill previous runs
runs-on: ubuntu-latest
# We want to run on external PRs, but not on our own internal PRs as they'll be run by the push to the branch.
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

execute_Lychee:
name: 1️⃣ PHP - Lychee
runs-on: ubuntu-latest
needs:
- kill_previous
steps:
- name: Extract branch name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
id: extract_branch

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: none
tools: phpstan
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout code
uses: actions/checkout@v3
with:
repository: 'LycheeOrg/Lychee'

- name: Fix composer.json
run: composer require --dev "lychee-org/phpstan-lychee":"dev-${{ steps.extract_branch.outputs.branch }}"

- name: Run PHPStan
run: vendor/bin/phpstan analyze

execute_php_exif:
name: 1️⃣ PHP - php-exif
runs-on: ubuntu-latest
needs:
- kill_previous
steps:
- name: Extract branch name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
id: extract_branch

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: none
tools: phpstan
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout code
uses: actions/checkout@v3
with:
repository: 'LycheeOrg/php-exif'

- name: Fix composer.json
run: composer require --dev "lychee-org/phpstan-lychee":"dev-${{ steps.extract_branch.outputs.branch }}"

- name: Run PHPStan
run: vendor/bin/phpstan analyze

execute_nested_sets:
if: ${{ false }} # disable for now
name: 1️⃣ PHP - Nested sets
runs-on: ubuntu-latest
needs:
- kill_previous
steps:
- name: Extract branch name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
id: extract_branch

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: none
tools: phpstan
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout code
uses: actions/checkout@v3
with:
repository: 'LycheeOrg/laravel-nestedset'
ref: 'enable-phpstan'

- name: Fix composer.json
run: |
composer require --dev "lychee-org/phpstan-lychee":"dev-${{ steps.extract_branch.outputs.branch }}"
- name: Run PHPStan
run: vendor/bin/phpstan analyze
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
"ergebnis/phpstan-rules": "^1.0",
"friendsofphp/php-cs-fixer": "^3.3",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/phpstan": "^1.7",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-strict-rules": "^1.3",
"phpstan/phpstan": "^1.7",
"slam/phpstan-extensions": "^6.0",
"squizlabs/php_codesniffer": "^3.5",
"symplify/phpstan-rules": "^11.0",
"thecodingmachine/phpstan-safe-rule": "^1.2"
},
"scripts": {
Expand Down
Loading

0 comments on commit 0c26789

Please sign in to comment.