Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#29 - update workflows to include composer install step #30

Merged
merged 11 commits into from
Feb 3, 2025
Prev Previous commit
Next Next commit
#29 - adjust downgrade process for older php versions
  • Loading branch information
maciej-sz committed Feb 2, 2025
commit e19c08d5203dca73e5646efb961858a63bcb072a
3 changes: 2 additions & 1 deletion .github/workflows/cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
PHP_VERSION: '8.3'
COMPOSER_NO_DEV: 0

jobs:
cs-fixer:
Expand Down Expand Up @@ -36,7 +37,7 @@ jobs:
${{ runner.os }}-${{ env.PHP_VERSION }}-

- name: Install dependencies
run: composer install --prefer-dist --no-progress --dev
run: composer install --prefer-dist --no-progress

- name: Run PHP CS Fixer
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deptrac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
PHP_VERSION: '8.3'
COMPOSER_NO_DEV: 0

jobs:
deptrac:
Expand Down Expand Up @@ -36,7 +37,7 @@ jobs:
${{ runner.os }}-${{ env.PHP_VERSION }}-

- name: Install dependencies
run: composer install --prefer-dist --no-progress --dev
run: composer install --prefer-dist --no-progress

- name: Run Deptrac
run: |
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/php-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
pull_request:
branches: [ "**" ]

env:
COMPOSER_NO_DEV: 0

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -28,9 +31,6 @@ jobs:
coverage: pcov
tools: composer:v2

- name: Adjust composer dependencies for older PHP versions
run: php scripts/adjust-deps-for-older-php-versions.php

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
Expand All @@ -40,8 +40,11 @@ jobs:
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-version }}-

- name: Adjust composer dependencies for older PHP versions
run: php scripts/adjust-deps-for-older-php-versions.php

- name: Install dependencies
run: composer install --prefer-dist --no-progress --dev
run: composer install --prefer-dist --no-progress

- name: Run all test suites
run: composer run-script test-all
3 changes: 2 additions & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
PHP_VERSION: '8.3'
COMPOSER_NO_DEV: 0

jobs:
phpstan:
Expand Down Expand Up @@ -36,7 +37,7 @@ jobs:
${{ runner.os }}-${{ env.PHP_VERSION }}-

- name: Install dependencies
run: composer install --prefer-dist --no-progress --dev
run: composer install --prefer-dist --no-progress

- name: Run PHPStan
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

env:
PHP_VERSION: '8.3'
COMPOSER_NO_DEV: 0

jobs:
check-coverage:
Expand Down Expand Up @@ -47,7 +48,7 @@ jobs:
${{ runner.os }}-php-${{ env.PHP_VERSION }}-

- name: Install dependencies
run: composer install --prefer-dist --no-progress --dev
run: composer install --prefer-dist --no-progress

- name: Run test suites with coverage on PR branch
run: |
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"friendsofphp/php-cs-fixer": "^3.16",
"phpstan/phpstan": "^1.10",
"donatj/mock-webserver": "^2.6",
"symfony/http-client": "^7.2",
"symfony/cache": "^7.2"
"symfony/http-client": "^6.4",
"symfony/cache": "^6.4"
},
"suggest": {
"psr/cache": "Allows local cache",
Expand Down
76 changes: 36 additions & 40 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions scripts/adjust-deps-for-older-php-versions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@

if (PHP_VERSION_ID < 80300) {
exec(
'composer require'
'composer update'
. ' --dev'
. ' --with-all-dependencies'
. ' --update-with-all-dependencies'
. ' --no-interaction'
. ' --no-progress'
. ' --prefer-lowest'
. ' --ignore-platform-reqs'
. ' symfony/cache:^6.4'
. ' symfony/http-client:^6.4'
);
}