Skip to content

refactor: Rework the composer root version checker into a proper sub-project #789

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

Merged
merged 5 commits into from
Dec 22, 2022
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
15 changes: 8 additions & 7 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
*.php text eol=lf

# Ignore all test and documentation with "export-ignore".
/.gitattributes export-ignore
/.gitignore export-ignore
/.styleci.yml export-ignore
/.travis.yml export-ignore
/.appveyor.yml export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.styleci.yml export-ignore
/.travis.yml export-ignore
/.appveyor.yml export-ignore
/phpunit.xml.dist export-ignore
/composer-root-version-checker export-ignore
/tests export-ignore
68 changes: 68 additions & 0 deletions .github/workflows/composer-root-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: RootVersionChecker

on:
push:
branches: [ main ]
pull_request:

jobs:
cs-lint:
runs-on: ubuntu-latest
name: CS lint
strategy:
fail-fast: false
matrix:
php: [ '8.1' ] # Should be the latest PHP version supported

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
tools: composer

- name: Install PHP-CS-Fixer
uses: ramsey/composer-install@v2
with:
working-directory: 'vendor-bin/php-cs-fixer'
tools: composer

- name: Ensures the makefile does not remake the PHP-CS-Fixer target
run: touch -c vendor-bin/php-cs-fixer/vendor/friendsofphp/php-cs-fixer/php-cs-fixer

- name: Install the Composer dependencies
uses: ramsey/composer-install@v2
with:
working-directory: 'composer-root-version-checker'

- name: Lints CS
run: cd composer-root-version-checker; make cs_lint

tests:
runs-on: ubuntu-latest
name: Tests
strategy:
fail-fast: false
matrix:
php: [ '8.1' ] # Should be the latest PHP version supported

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
tools: composer

- name: Install the Composer dependencies
uses: ramsey/composer-install@v2
with:
working-directory: 'composer-root-version-checker'

- name: Runs the tests
run: cd composer-root-version-checker; make test
7 changes: 6 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '8.1' ]
php: [ '8.1' ] # Should be the latest PHP version supported
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -29,6 +29,11 @@ jobs:
tools: composer
coverage: none

- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
working-directory: 'composer-root-version-checker'

- name: Check COMPOSER_ROOT_VERSION
run: make check_composer_root_version

Expand Down
3 changes: 3 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

$finder = Finder::create()
->in([
'composer-root-version-checker/bin',
'composer-root-version-checker/src',
'composer-root-version-checker/tests',
'src',
'tests',
])
Expand Down
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ build:
image: default-bionic
environment:
variables:
COMPOSER_ROOT_VERSION: '0.17.99'
COMPOSER_ROOT_VERSION: '0.18.0-rc.0'

nodes:
analysis:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ validate_package:
.PHONY: check_composer_root_version
check_composer_root_version: ## Checks that the COMPOSER_ROOT_VERSION is up to date
check_composer_root_version: .composer-root-version
php bin/check-composer-root-version.php
cd composer-root-version-checker; $(MAKE) --makefile Makefile check_root_version

.PHONY: covers_validator
covers_validator: ## Checks PHPUnit @coves tag
Expand Down
54 changes: 0 additions & 54 deletions bin/check-composer-root-version.php

This file was deleted.

59 changes: 0 additions & 59 deletions bin/dump-composer-root-version.php

This file was deleted.

115 changes: 0 additions & 115 deletions bin/root-version.php

This file was deleted.

1 change: 1 addition & 0 deletions composer-root-version-checker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor/
Loading