Changeset 55482 for branches/6.0/.github/workflows/php-compatibility.yml
- Timestamp:
- 03/07/2023 07:36:29 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.0/.github/workflows/php-compatibility.yml
r53595 r55482 45 45 # - Logs debug information. 46 46 # - Configures caching for PHP compatibility scans. 47 # - Installs Composer dependencies (use cache if possible).47 # - Installs Composer dependencies. 48 48 # - Make Composer packages available globally. 49 # - Logs PHP_CodeSniffer debug information.50 49 # - Runs the PHP compatibility tests. 50 # - Generate a report for displaying issues as pull request annotations. 51 51 # - Ensures version-controlled files are not modified or deleted. 52 52 php-compatibility: … … 58 58 steps: 59 59 - name: Checkout repository 60 uses: actions/checkout@ 2541b1294d2704b0964813337f33b291d3f8596b # v3.0.260 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 61 61 62 62 - name: Set up PHP 63 uses: shivammathur/setup-php@ 3eda58347216592f618bb1dff277810b6698e4ca # v2.19.163 uses: shivammathur/setup-php@8e2ac35f639d3e794c1da1f28999385ab6fdf0fc # v2.23.0 64 64 with: 65 65 php-version: '7.4' 66 66 coverage: none 67 tools: c omposer, cs2pr67 tools: cs2pr 68 68 69 69 - name: Log debug information 70 70 run: | 71 php --version72 71 composer --version 73 72 … … 76 75 - name: "Get last Monday's date" 77 76 id: get-date 78 run: echo " ::set-output name=date::$(/bin/date -u --date='last Mon' "+%F")"77 run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT 79 78 80 79 - name: Cache PHP compatibility scan cache 81 uses: actions/cache@ c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.480 uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3 82 81 with: 83 82 path: .cache/phpcompat.json 84 83 key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }} 85 84 85 # Since Composer dependencies are installed using `composer update` and no lock file is in version control, 86 # passing a custom cache suffix ensures that the cache is flushed at least once per week. 86 87 - name: Install Composer dependencies 87 uses: ramsey/composer-install@ f680dac46551dffb2234a240d65ae806c2999dd6 # v2.1.088 uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0 88 89 with: 89 c omposer-options: "--no-progress --no-ansi --no-interaction"90 custom-cache-suffix: ${{ steps.get-date.outputs.date }} 90 91 91 92 - name: Make Composer packages available globally 92 93 run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH 93 94 94 - name: Log PHPCS debug information 95 run: phpcs -i 95 - name: Run PHP compatibility tests 96 id: phpcs 97 run: phpcs --standard=phpcompat.xml.dist --report-full --report-checkstyle=./.cache/phpcs-compat-report.xml 96 98 97 - name: Run PHP compatibility tests 98 run: phpcs --standard=phpcompat.xml.dist -q --report=checkstyle | cs2pr 99 - name: Show PHPCompatibility results in PR 100 if: ${{ always() && steps.phpcs.outcome == 'failure' }} 101 run: cs2pr ./.cache/phpcs-compat-report.xml 99 102 100 103 - name: Ensure version-controlled files are not modified or deleted … … 113 116 SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} 114 117 SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} 118 119 failed-workflow: 120 name: Failed workflow tasks 121 runs-on: ubuntu-latest 122 needs: [ php-compatibility, slack-notifications ] 123 if: | 124 always() && 125 github.repository == 'WordPress/wordpress-develop' && 126 github.event_name != 'pull_request' && 127 github.run_attempt < 2 && 128 ( 129 needs.php-compatibility.result == 'cancelled' || needs.php-compatibility.result == 'failure' 130 ) 131 132 steps: 133 - name: Dispatch workflow run 134 uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0 135 with: 136 retries: 2 137 retry-exempt-status-codes: 418 138 script: | 139 github.rest.actions.createWorkflowDispatch({ 140 owner: context.repo.owner, 141 repo: context.repo.repo, 142 workflow_id: 'failed-workflow.yml', 143 ref: 'trunk', 144 inputs: { 145 run_id: '${{ github.run_id }}' 146 } 147 });
Note: See TracChangeset
for help on using the changeset viewer.