-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lint yaml files and Using semantic versions
- Loading branch information
Showing
4 changed files
with
87 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
name: Bare Run on various PHP versions | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*.72' | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
bare_run: | ||
runs-on: ubuntu-latest | ||
bare_run: | ||
if: git tag -l --format='%(contents)' $(git describe --tags $(git rev-list --tags --max-count=1)) |grep -q "PHP 7.2 downgraded" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php_version: ['7.2', '7.3', '7.4', '8.0'] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php_version: ['7.2', '7.3', '7.4', '8.0'] | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php_version }} | ||
coverage: none | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php_version }} | ||
coverage: none | ||
|
||
- run: php bin/monorepo-builder list --ansi | ||
- run: php bin/monorepo-builder list --ansi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,57 @@ | ||
name: Code Analysis | ||
|
||
on: | ||
pull_request: null | ||
push: | ||
branches: | ||
- main | ||
pull_request: null | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
code_analysis: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
actions: | ||
- | ||
name: 'PHPStan' | ||
run: composer phpstan --ansi | ||
|
||
- | ||
name: 'Composer Validate' | ||
run: composer validate --ansi | ||
|
||
- | ||
name: 'Rector' | ||
run: composer rector --ansi | ||
|
||
- | ||
name: 'Coding Standard' | ||
run: composer fix-cs --ansi | ||
|
||
- | ||
name: 'Tests' | ||
run: vendor/bin/phpunit --testdox | ||
|
||
- | ||
name: 'PHP Linter' | ||
run: vendor/bin/parallel-lint src tests | ||
|
||
- | ||
name: 'Check Commented Code' | ||
run: vendor/bin/easy-ci check-commented-code src tests --ansi | ||
|
||
- | ||
name: 'Check Active Classes' | ||
run: vendor/bin/class-leak check src packages bin --ansi --skip-type="Symplify\MonorepoBuilder\Release\Contract\ReleaseWorker\ReleaseWorkerInterface" --skip-type="\Symplify\MonorepoBuilder\Merge\Contract\ComposerKeyMergerInterface" --skip-type="\Symplify\MonorepoBuilder\Merge\Contract\ComposerJsonDecoratorInterface" | ||
|
||
name: ${{ matrix.actions.name }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
# see https://github.com/shivammathur/setup-php | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.1 | ||
coverage: none | ||
|
||
# composer install cache - https://github.com/ramsey/composer-install | ||
- uses: "ramsey/composer-install@v2" | ||
|
||
- run: ${{ matrix.actions.run }} | ||
code_analysis: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
actions: | ||
- | ||
name: 'PHPStan' | ||
run: composer phpstan --ansi | ||
|
||
- | ||
name: 'Composer Validate' | ||
run: composer validate --ansi | ||
|
||
- | ||
name: 'Rector' | ||
run: composer rector --ansi | ||
|
||
- | ||
name: 'Coding Standard' | ||
run: composer fix-cs --ansi | ||
|
||
- | ||
name: 'Tests' | ||
run: vendor/bin/phpunit --testdox | ||
|
||
- | ||
name: 'PHP Linter' | ||
run: vendor/bin/parallel-lint src tests | ||
|
||
- | ||
name: 'Check Commented Code' | ||
run: vendor/bin/easy-ci check-commented-code src tests --ansi | ||
|
||
- | ||
name: 'Check Active Classes' | ||
run: vendor/bin/class-leak check src packages bin --ansi --skip-type="Symplify\MonorepoBuilder\Release\Contract\ReleaseWorker\ReleaseWorkerInterface" --skip-type="\Symplify\MonorepoBuilder\Merge\Contract\ComposerKeyMergerInterface" --skip-type="\Symplify\MonorepoBuilder\Merge\Contract\ComposerJsonDecoratorInterface" | ||
|
||
name: ${{ matrix.actions.name }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.1 | ||
coverage: none | ||
- uses: "ramsey/composer-install@v2" | ||
- run: ${{ matrix.actions.run }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,19 +3,17 @@ name: Downgraded Release | |
on: | ||
push: | ||
tags: | ||
# avoid infinite looping, skip tags that ends with ".72" | ||
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-and-excluding-branches | ||
- '*' | ||
- '!**.72' | ||
|
||
jobs: | ||
downgrade_release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: "actions/checkout@v3" | ||
with: | ||
token: ${{ secrets.WORKFLOWS_TOKEN }} | ||
- uses: "actions/checkout@v3" | ||
with: | ||
token: ${{ secrets.WORKFLOWS_TOKEN }} | ||
|
||
- | ||
uses: "shivammathur/setup-php@v2" | ||
|
@@ -24,42 +22,41 @@ jobs: | |
coverage: none | ||
|
||
# invoke patches | ||
- run: composer install --ansi | ||
- run: composer install --ansi | ||
|
||
# but no dev packages | ||
- run: composer update --no-dev --ansi | ||
- run: composer update --no-dev --ansi | ||
|
||
# get rector to "rector-local" directory, to avoid downgrading itself in the /vendor | ||
- run: mkdir rector-local | ||
- run: composer require rector/rector --working-dir rector-local --ansi | ||
- run: mkdir rector-local | ||
- run: composer require rector/rector --working-dir rector-local --ansi | ||
|
||
# downgrade to PHP 7.2 | ||
- run: rector-local/vendor/bin/rector process bin src packages config vendor --config build/rector-downgrade-php-72.php --ansi | ||
- run: rector-local/vendor/bin/rector process bin src packages config vendor --config build/rector-downgrade-php-72.php --ansi | ||
|
||
# clear the dev files | ||
- run: rm -rf tests ecs.php phpstan.neon phpunit.xml .gitignore .editorconfig | ||
- run: rm -rf tests ecs.php phpstan.neon phpunit.xml .gitignore .editorconfig | ||
|
||
# prefix and scope | ||
- run: sh prefix-code.sh | ||
- run: sh prefix-code.sh | ||
|
||
# copy PHP 7.2 composer + workflows | ||
- run: cp -r build/target-repository/. . | ||
- run: cp -r build/target-repository/. . | ||
|
||
# clear the dev files | ||
- run: rm -rf build prefix-code.sh monorepo-builder.php full-tool-build.sh scoper.php rector.php rector-local packages-tests php-scoper.phar | ||
- run: rm -rf build prefix-code.sh monorepo-builder.php full-tool-build.sh scoper.php rector.php rector-local packages-tests php-scoper.phar | ||
|
||
# setup git user | ||
- | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "GitHub Action" | ||
# publish to the same repository with a new tag | ||
# see https://tomasvotruba.com/blog/how-to-release-php-81-and-72-package-in-the-same-repository/ | ||
- | ||
name: "Tag Downgraded Code" | ||
run: | | ||
# separate a "git add" to add untracked (new) files too | ||
git add --all | ||
git commit -m "release PHP 7.2 downgraded" | ||
git tag "${GITHUB_REF#refs/tags/}.72" | ||
git push origin "${GITHUB_REF#refs/tags/}.72" | ||
git tag -a "${GITHUB_REF#refs/tags/}" -m 'PHP 7.2 downgraded' --force | ||
git push origin "${GITHUB_REF#refs/tags/}" --force |