Skip to content

Commit

Permalink
Merge pull request #27 from veewee/reproducability
Browse files Browse the repository at this point in the history
Make reproducable composer.lock available in main repo instead of here
  • Loading branch information
veewee authored Dec 22, 2023
2 parents 976cfa9 + 7b9c7a2 commit da789e1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7,110 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.1', '8.2']
php-versions: ['8.1', '8.2', '8.3']
fail-fast: false
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}
steps:
Expand Down
15 changes: 3 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ help:

compile:
$(if $(TAG),,$(error TAG is not defined. Pass via "make compile TAG=4.2.1"))
$(if $(PHP),,$(error PHP is not defined. Pass via "make compile PHP=7.4.19"))
@echo Compiling $(TAG)
$(eval BUILD_DIR := $(shell mktemp -d -t grumphp-shim-build))
@echo Cloning GrumPHP $(TAG) in directory $(BUILD_DIR)
git clone [email protected]:phpro/grumphp.git $(BUILD_DIR)
git --work-tree=$(BUILD_DIR) --git-dir='$(BUILD_DIR)/.git' checkout 'tags/v$(TAG)'
make prepare BUILD_DIR=$(BUILD_DIR) PHP=$(PHP)
make prepare BUILD_DIR=$(BUILD_DIR)
make sanity BUILD_DIR=$(BUILD_DIR)
make cleanup BUILD_DIR=$(BUILD_DIR)
# Release tag
Expand All @@ -27,29 +26,21 @@ release:

testlocal:
$(if $(GRUMPHP_DIR),,$(error GRUMPHP_DIR is not defined. Pass via "make testlocal GRUMPHP_DIR=/path/to/grumphp"))
$(if $(PHP),,$(error PHP is not defined. Pass via "make testlocal PHP=7.4"))
$(eval BUILD_DIR := $(shell mktemp -d -t grumphp-shim-build))
@echo Copying GrumPHP to directory $(BUILD_DIR)
cp -r $(GRUMPHP_DIR)/. $(BUILD_DIR)
make prepare BUILD_DIR=$(BUILD_DIR) PHP=$(PHP)
make prepare BUILD_DIR=$(BUILD_DIR)
make cleanup BUILD_DIR=$(BUILD_DIR)

systemupdate:
composer self-update

prepare:
$(if $(PHP),,$(error PHP is not defined. Pass via "make prepare PHP=7.4.19"))
$(if $(BUILD_DIR),,$(error BUILD_DIR is not defined. Pass via "make prepare BUILD_DIR=/tmp/prepared-grumphp-src"))
make systemupdate
cp build/* '$(BUILD_DIR)'
cp src/Composer/FixBrokenStaticAutoloader.php '$(BUILD_DIR)/src/Composer'
php $(BUILD_DIR)/fix-some-stuff-in-composer.php
composer --working-dir='$(BUILD_DIR)' config platform.php '$(PHP)'
composer install --working-dir='$(BUILD_DIR)' --no-scripts --no-plugins --no-dev --no-interaction --optimize-autoloader
php -d error_reporting='(E_ALL & ~E_DEPRECATED)' ./vendor/bin/box compile --working-dir='$(BUILD_DIR)' -vvv
# Copy composer plugin
cp '$(BUILD_DIR)/src/Composer/GrumPHPPlugin.php' '$(ROOT_DIR)/src/Composer/GrumPHPPlugin.php'
cp '$(BUILD_DIR)/composer.lock' '$(ROOT_DIR)/phar.composer.lock'
# All good : lets finish up
cp '$(BUILD_DIR)/grumphp.phar' '$(ROOT_DIR)'
gpg --local-user [email protected] --armor --detach-sign grumphp.phar
Expand All @@ -59,7 +50,7 @@ sanity:
$(if $(BUILD_DIR),,$(error BUILD_DIR is not defined. Pass via "make sanity BUILD_DIR=/tmp/prepared-grumphp-src"))
mv '$(BUILD_DIR)/composer.json.backup' '$(BUILD_DIR)/composer.json'
rm -rf '$(BUILD_DIR)/vendor'
composer update --dev --working-dir='$(BUILD_DIR)' --no-interaction
composer install --working-dir='$(BUILD_DIR)' --no-interaction
cd $(BUILD_DIR) && ./grumphp.phar run --testsuite=git_pre_commit && cd $(ROOT_DIR)

cleanup:
Expand Down
3 changes: 0 additions & 3 deletions build/fix-some-stuff-in-composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
$composerFile,
json_encode(
array_merge_recursive($composerData, [
'require' => [
'nikic/php-parser' => '~4.0',
],
'scripts' => [
'post-autoload-dump' => [
'GrumPHP\\Composer\\FixBrokenStaticAutoloader::fix'
Expand Down
Loading

0 comments on commit da789e1

Please sign in to comment.