Skip to content
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
73 changes: 62 additions & 11 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,23 @@ jobs:
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
extensions: intl, sodium
ini-values: memory_limit=-1

- name: "Install dependencies"
uses: "ramsey/composer-install@3.0.0"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Install CI dependencies"
uses: "ramsey/composer-install@2.2.0"
with:
dependency-versions: "${{ matrix.dependencies }}"
working-directory: "tools"
custom-cache-suffix: "ci"

- name: "Tests"
run: "vendor/bin/phpunit"
run: "tools/vendor/bin/phpunit"

static-analysis-phpstan:
name: "Static Analysis by PHPStan"
Expand All @@ -73,15 +81,23 @@ jobs:
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: intl, sodium
ini-values: memory_limit=-1

- name: "Install dependencies"
uses: "ramsey/composer-install@3.0.0"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Install CI dependencies"
uses: "ramsey/composer-install@2.2.0"
with:
dependency-versions: "${{ matrix.dependencies }}"
working-directory: "tools"
custom-cache-suffix: "ci"

- name: "PHPStan"
run: "vendor/bin/phpstan analyse --memory-limit=-1"
run: "tools/vendor/bin/phpstan analyse --memory-limit=-1"

static-analysis-psalm:
name: "Static Analysis by Psalm"
Expand All @@ -106,15 +122,23 @@ jobs:
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: intl, sodium
ini-values: memory_limit=-1

- name: "Install dependencies"
uses: "ramsey/composer-install@3.0.0"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Install CI dependencies"
uses: "ramsey/composer-install@2.2.0"
with:
dependency-versions: "${{ matrix.dependencies }}"
working-directory: "tools"
custom-cache-suffix: "ci"

- name: "psalm"
run: "vendor/bin/psalm --shepherd --stats"
run: "tools/vendor/bin/psalm --shepherd --stats"

mutation-tests:
name: "Mutation tests"
Expand All @@ -139,15 +163,23 @@ jobs:
with:
coverage: "xdebug"
php-version: "${{ matrix.php-version }}"
extensions: intl, sodium
ini-values: memory_limit=-1, zend.assertions=1

- name: "Install dependencies"
uses: "ramsey/composer-install@3.0.0"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Install CI dependencies"
uses: "ramsey/composer-install@2.2.0"
with:
dependency-versions: "${{ matrix.dependencies }}"
working-directory: "tools"
custom-cache-suffix: "ci"

- name: "Infection"
run: "vendor/bin/roave-infection-static-analysis-plugin --threads=$(nproc)"
run: "tools/vendor/bin/roave-infection-static-analysis-plugin --threads=$(nproc)"
env:
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
Expand Down Expand Up @@ -176,15 +208,23 @@ jobs:
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: intl, sodium
ini-values: memory_limit=-1

- name: "Install dependencies"
uses: "ramsey/composer-install@3.0.0"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Install CI dependencies"
uses: "ramsey/composer-install@2.2.0"
with:
dependency-versions: "${{ matrix.dependencies }}"
working-directory: "tools"
custom-cache-suffix: "ci"

- name: "Test Compatibility"
run: "vendor/bin/phpunit test/compat"
run: "tools/vendor/bin/phpunit test/compat"

demo-scripts:
name: "Check Demo Scripts"
Expand All @@ -209,6 +249,7 @@ jobs:
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: intl, sodium
ini-values: memory_limit=-1

- name: "Install dependencies"
Expand Down Expand Up @@ -243,18 +284,23 @@ jobs:
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: intl, sodium
ini-values: memory_limit=-1

- name: "Install dependencies"
uses: "ramsey/composer-install@3.0.0"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Install PhpBench"
run: "composer require --with-all-dependencies --dev --prefer-stable --no-interaction --no-progress phpbench/phpbench:^1.1.1"
- name: "Install CI dependencies"
uses: "ramsey/composer-install@2.2.0"
with:
dependency-versions: "${{ matrix.dependencies }}"
working-directory: "tools"
custom-cache-suffix: "ci"

- name: "PhpBench"
run: "vendor/bin/phpbench run --progress=dots --iterations=1"
run: "tools/vendor/bin/phpbench run --progress=dots --iterations=1"

coding-standards:
name: "Check Coding Standards"
Expand All @@ -279,15 +325,18 @@ jobs:
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: intl, sodium
ini-values: memory_limit=-1

- name: "Install dependencies"
uses: "ramsey/composer-install@3.0.0"
with:
dependency-versions: "${{ matrix.dependencies }}"
working-directory: "tools"
custom-cache-suffix: "ci"

- name: "Coding Standard"
run: "vendor/bin/phpcs"
run: "tools/vendor/bin/phpcs"

backward-compatibility:
name: "Check Backward Compatibility"
Expand Down Expand Up @@ -315,13 +364,15 @@ jobs:
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: intl, sodium
ini-values: memory_limit=-1

- name: "Install dependencies"
uses: "ramsey/composer-install@3.0.0"
with:
dependency-versions: "${{ matrix.dependencies }}"
working-directory: "tools/roave-backward-compatibility-check"
working-directory: "tools"
custom-cache-suffix: "ci"

- name: "BC Checks"
run: tools/roave-backward-compatibility-check/vendor/bin/roave-backward-compatibility-check --from=origin/${{ github.base_ref }}
run: tools/vendor/bin/roave-backward-compatibility-check --from=origin/${{ github.base_ref }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.phpcs-cache
/.phpunit.cache
/phpcs.xml
/tools/roave-backward-compatibility-check/vendor
/tools/vendor
/vendor

25 changes: 1 addition & 24 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,40 +32,17 @@
}

],
"require-dev": {
"doctrine/coding-standard": "^12.0.0",
"phpstan/phpstan": "^1.10.60",
"phpstan/phpstan-phpunit": "^1.3.16",
"phpunit/phpunit": "^10.5.12",
"vimeo/psalm": "5.23.0",
"roave/infection-static-analysis-plugin": "^1.34.0"
Copy link
Member

Choose a reason for hiding this comment

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

This tool shares the same address space as the main library: moving it here may be a mistake (same for phpunit).

I think we should only move tools that operate completely independently, which currently includes phpcs, phpstan (not psalm, due to the coupling with the test suite mutations).

That said, I'm fine with trying this out anyway 👍

},
"autoload": {
"psr-4": {
"Roave\\BetterReflection\\": "src"
}
},
"autoload-dev": {
Copy link
Member

Choose a reason for hiding this comment

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

This will also mess with editors 🤔

I'm not convinced of moving everything, but I'm open to trying it, for now 🤔

"psr-4": {
"Roave\\BetterReflectionTest\\": "test/unit",
"Roave\\BetterReflectionBenchmark\\": "test/benchmark"
}
},
"conflict": {
"thecodingmachine/safe": "<1.1.3"
},
"suggest": {
"composer/composer": "Required to use the ComposerSourceLocator"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"infection/extension-installer": false
},
"platform": {
"php": "8.1.99"
}
}
"prefer-stable": true
}
Loading