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

Make reproducable composer.lock available in repo #1117

Merged
merged 1 commit into from
Dec 22, 2023
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
27 changes: 18 additions & 9 deletions .github/workflows/grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
matrix:
operating-system: [ubuntu-latest, macos-latest] #windows-latest currently not working
php-versions: ['8.1', '8.2', '8.3']
composer-options: ['', '--prefer-lowest']
composer-deps: ['highest', 'lowest', 'lock']
composer-versions: ['composer:v2']
fail-fast: false
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} with ${{ matrix.composer-versions }} ${{ matrix.composer-options }}
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} with ${{ matrix.composer-versions }} ${{ matrix.composer-deps }}
steps:
- name: Checkout
uses: actions/checkout@master
Expand All @@ -29,6 +29,10 @@ jobs:
php -v
php -m
composer --version
- name: Set env vars for latest PHP version
if: matrix.php-versions == '8.3'
run: |
export COMPOSER_IGNORE_PLATFORM_REQ=php+
- name: Get composer cache directory
id: composercache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
Expand All @@ -38,12 +42,17 @@ jobs:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
if: matrix.php-versions != '8.3'
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }}
- name: Install dependencies (Ignore platform)
if: matrix.php-versions == '8.3'
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }} --ignore-platform-req=php+
- name: Install dependencies (highest)
if: matrix.composer-deps == 'highest'
run: composer update --prefer-dist --no-progress --no-suggest
- name: Install dependencies (lowest)
if: matrix.composer-deps == 'lowest'
run: composer update --prefer-dist --no-progress --no-suggest --prefer-lowest
- name: Install dependencies (lock)
if: matrix.composer-deps == 'lock'
run: |
composer install --no-progress --no-suggest
composer validate
- name: Set git variables
run: |
git config --global user.email "[email protected]"
Expand All @@ -55,6 +64,6 @@ jobs:
- name: Run the tests on unix
if: runner.os != 'Windows'
run: php vendor/bin/grumphp run --no-interaction --testsuite=ci
continue-on-error: ${{ matrix.php-versions == '8.1' && matrix.composer-options == '--prefer-lowest' }}
#continue-on-error: ${{ matrix.php-versions == '8.1' && matrix.composer-options == '--prefer-lowest' }}
- name: Run paratest outside of grumphp
run: php ./vendor/bin/paratest --testsuite=E2E -f --verbose
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
vendor
composer.lock
grumphp.yml
.phpunit.result.cache
!/.github/workflows/grumphp.yml
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ tag:
git add -A
git commit -m '$(TAG) release'
git tag -s 'v$(TAG)' -m'Version $(TAG)'

lock:
$(if $(PHP),,$(error PHP is not defined. Pass via "make lock PHP=8.1"))
composer self-update
composer config platform.php '$(PHP)'
composer update --no-scripts --no-plugins --no-interaction --optimize-autoloader
composer validate
7 changes: 4 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ platform:

environment:
matrix:
- dependencies: highest
- dependencies: lock
php_version: 8.3
- dependencies: highest
- dependencies: lock
php_version: 8.2
- dependencies: highest
- dependencies: lock
php_version: 8.1

project_directory: c:\projects\grumphp
Expand Down Expand Up @@ -69,6 +69,7 @@ install:
- ps: cd $Env:project_directory
- IF %dependencies%==lowest composer update --prefer-dist --prefer-lowest --prefer-stable --no-progress --no-scripts --no-suggest --profile --ignore-platform-req=php+
- IF %dependencies%==highest composer update --prefer-dist --no-progress --no-scripts --no-suggest --profile --ignore-platform-req=php+
- IF %dependencies%==lock composer install --no-scripts --no-suggest --profile
- git config --global user.email "[email protected]"
- git config --global user.name "GrumPHP"
- git config --global protocol.file.allow always
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
"bin/grumphp"
],
"config": {
"platform": {
"php": "8.1"
},
"sort-packages": true
},
"extra": {
Expand Down
Loading