Skip to content

Commit

Permalink
Switch PHP version on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Feb 26, 2025
1 parent c804d92 commit 91016cc
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 7 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/behat-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP for PHP-Scoper
uses: shivammathur/setup-php@v2
with:
tools: composer
php-version: 8.4
coverage: none

- name: Install PHP-Scoper
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a
with:
working-directory: "vendor-bin/php-scoper"
composer-options: '--prefer-dist'

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -95,6 +108,10 @@ jobs:
with:
composer-options: '--prefer-dist'

- name: Prefix Composer dependencies
run: |
composer prefix-dependencies
- name: Make Composer packages available globally
run: |
echo "${PWD}/vendor/bin" >> $GITHUB_PATH
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/php-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,22 @@ jobs:
- name: Validate Composer configuration
run: composer validate

- name: Install PHP-Scoper
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a
with:
working-directory: "vendor-bin/php-scoper"
composer-options: '--prefer-dist'


- name: Install PHP dependencies
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a
with:
composer-options: '--prefer-dist'

- name: Prefix Composer dependencies
run: |
composer prefix-dependencies
- name: PHP Lint
run: composer lint

Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/php-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup PHP for PHP-Scoper
uses: shivammathur/setup-php@v2
with:
tools: composer
php-version: 8.4
coverage: none

- name: Install PHP-Scoper
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a
with:
working-directory: "vendor-bin/php-scoper"
composer-options: '--prefer-dist'

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
Expand All @@ -77,6 +90,10 @@ jobs:
with:
composer-options: '--prefer-dist'

- name: Prefix Composer dependencies
run: |
composer prefix-dependencies
- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@v4
with:
Expand Down
8 changes: 1 addition & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"bamarni-bin": {
"bin-links": false,
"target-directory": "vendor-bin",
"forward-command": true
"forward-command": false
}
},
"scripts": {
Expand All @@ -79,12 +79,6 @@
"phpstan": "phpstan analyse --memory-limit=2048M",
"prepare-behat-tests": "install-package-tests",
"test": "phpunit",
"post-install-cmd": [
"@prefix-dependencies"
],
"post-update-cmd": [
"@prefix-dependencies"
],
"prefix-dependencies": [
"vendor-bin/php-scoper/vendor/bin/php-scoper add-prefix --output-dir=./vendor-prefixed --force --quiet",
"echo '{ \"autoload\": { \"classmap\": [\"\"] } }' > ./vendor-prefixed/composer.json",
Expand Down

0 comments on commit 91016cc

Please sign in to comment.