diff --git a/.editorconfig b/.editorconfig index bec95c4494..f73a7bb1ce 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,3 +7,6 @@ insert_final_newline = true trim_trailing_whitespace = true indent_style = space indent_size = 4 + +[*.{yml,yaml}] +indent_size = 2 diff --git a/.github/workflows/bare_run.yaml b/.github/workflows/bare_run.yaml index 82800cd8b5..8829612466 100644 --- a/.github/workflows/bare_run.yaml +++ b/.github/workflows/bare_run.yaml @@ -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 diff --git a/.github/workflows/code_analysis.yaml b/.github/workflows/code_analysis.yaml index f0b930f2c4..3b95444d32 100644 --- a/.github/workflows/code_analysis.yaml +++ b/.github/workflows/code_analysis.yaml @@ -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 }} diff --git a/.github/workflows/downgraded_release.yaml b/.github/workflows/downgraded_release.yaml index bf9bcc9dc3..d86766a766 100644 --- a/.github/workflows/downgraded_release.yaml +++ b/.github/workflows/downgraded_release.yaml @@ -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 "action@github.com" 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