Skip to content

Commit

Permalink
Merge pull request #1391 from kukulich/ci
Browse files Browse the repository at this point in the history
CI tools moved to special composer.json
  • Loading branch information
kukulich authored Mar 10, 2024
2 parents d5cdeb9 + 7bb22f2 commit 8d1a2ad
Show file tree
Hide file tree
Showing 13 changed files with 7,049 additions and 7,700 deletions.
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/[email protected]"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Install CI dependencies"
uses: "ramsey/[email protected]"
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/[email protected]"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Install CI dependencies"
uses: "ramsey/[email protected]"
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/[email protected]"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Install CI dependencies"
uses: "ramsey/[email protected]"
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/[email protected]"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Install CI dependencies"
uses: "ramsey/[email protected]"
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/[email protected]"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Install CI dependencies"
uses: "ramsey/[email protected]"
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/[email protected]"
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/[email protected]"
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/[email protected]"
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/[email protected]"
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"
},
"autoload": {
"psr-4": {
"Roave\\BetterReflection\\": "src"
}
},
"autoload-dev": {
"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

0 comments on commit 8d1a2ad

Please sign in to comment.