Skip to content

Commit

Permalink
Add class-leak to CI (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba authored Jul 21, 2023
1 parent 04d257d commit 26e8bb4
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 7 deletions.
32 changes: 25 additions & 7 deletions .github/workflows/code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,32 @@ on:
branches:
- main

env:
# see https://github.com/composer/composer/issues/9368#issuecomment-718112361
COMPOSER_ROOT_VERSION: "dev-main"

jobs:
code_analysis:
# see https://github.com/rectorphp/reusable-workflows
uses: rectorphp/reusable-workflows/.github/workflows/code_analysis.yaml@main
strategy:
fail-fast: false
matrix:
actions:
-
name: 'Active Classes'
run: vendor/bin/class-leak check config src rules

name: ${{ matrix.actions.name }}
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3

rector:
# run only on main repository, not on the forks without access
if: github.repository == 'rectorphp/rector-downgrade-php'
-
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none

# see https://github.com/rectorphp/reusable-workflows
uses: rectorphp/reusable-workflows/.github/workflows/rector.yaml@main
- uses: "ramsey/composer-install@v2"
- run: ${{ matrix.actions.run }}
19 changes: 19 additions & 0 deletions .github/workflows/code_analysis_reusable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Code Analysis Reusable

on:
pull_request: null
push:
branches:
- main

jobs:
code_analysis_reusable:
# see https://github.com/rectorphp/reusable-workflows
uses: rectorphp/reusable-workflows/.github/workflows/code_analysis.yaml@main

rector:
# run only on main repository, not on the forks without access
if: github.repository == 'rectorphp/rector-downgrade-php'

# see https://github.com/rectorphp/reusable-workflows
uses: rectorphp/reusable-workflows/.github/workflows/rector.yaml@main
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"symplify/phpstan-rules": "^11.4",
"symplify/rule-doc-generator": "^11.2",
"symplify/vendor-patches": "^11.2",
"tomasvotruba/class-leak": "0.0.22.72",
"tomasvotruba/cognitive-complexity": "^0.1",
"tomasvotruba/type-coverage": "^0.2",
"tomasvotruba/unused-public": "^0.1"
Expand Down

0 comments on commit 26e8bb4

Please sign in to comment.