Changeset 58302 for branches/6.2/.github/workflows/php-compatibility.yml
- Timestamp:
- 06/03/2024 05:36:35 PM (6 months ago)
- Location:
- branches/6.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.2
- Property svn:mergeinfo changed
/trunk merged: 57124-57125,57249,57918,58157
- Property svn:mergeinfo changed
-
branches/6.2/.github/workflows/php-compatibility.yml
r55487 r58302 36 36 cancel-in-progress: true 37 37 38 # Disable permissions for all available scopes by default. 39 # Any needed permissions should be configured at the job level. 40 permissions: {} 41 38 42 jobs: 39 40 43 # Runs PHP compatibility testing. 41 #42 # Violations are reported inline with annotations.43 #44 # Performs the following steps:45 # - Checks out the repository.46 # - Sets up PHP.47 # - Logs debug information.48 # - Configures caching for PHP compatibility scans.49 # - Installs Composer dependencies.50 # - Make Composer packages available globally.51 # - Runs the PHP compatibility tests.52 # - Generate a report for displaying issues as pull request annotations.53 # - Ensures version-controlled files are not modified or deleted.54 44 php-compatibility: 55 45 name: Check PHP compatibility 56 runs-on: ubuntu-latest 57 timeout-minutes: 20 46 uses: WordPress/wordpress-develop/.github/workflows/reusable-php-compatibility.yml@trunk 47 permissions: 48 contents: read 58 49 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 59 60 steps: 61 - name: Checkout repository 62 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 63 64 - name: Set up PHP 65 uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0 66 with: 67 php-version: '7.4' 68 coverage: none 69 tools: cs2pr 70 71 - name: Log debug information 72 run: | 73 composer --version 74 75 # This date is used to ensure that the PHP compatibility cache is cleared at least once every week. 76 # http://man7.org/linux/man-pages/man1/date.1.html 77 - name: "Get last Monday's date" 78 id: get-date 79 run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT 80 81 - name: Cache PHP compatibility scan cache 82 uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6 83 with: 84 path: .cache/phpcompat.json 85 key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }} 86 87 # Since Composer dependencies are installed using `composer update` and no lock file is in version control, 88 # passing a custom cache suffix ensures that the cache is flushed at least once per week. 89 - name: Install Composer dependencies 90 uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0 91 with: 92 custom-cache-suffix: ${{ steps.get-date.outputs.date }} 93 94 - name: Make Composer packages available globally 95 run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH 96 97 - name: Run PHP compatibility tests 98 id: phpcs 99 run: phpcs --standard=phpcompat.xml.dist --report-full --report-checkstyle=./.cache/phpcs-compat-report.xml 100 101 - name: Show PHPCompatibility results in PR 102 if: ${{ always() && steps.phpcs.outcome == 'failure' }} 103 run: cs2pr ./.cache/phpcs-compat-report.xml 104 105 - name: Ensure version-controlled files are not modified or deleted 106 run: git diff --exit-code 50 with: 51 php-version: '7.4' 107 52 108 53 slack-notifications: 109 54 name: Slack Notifications 110 55 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 56 permissions: 57 actions: read 58 contents: read 111 59 needs: [ php-compatibility ] 112 60 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} … … 122 70 name: Failed workflow tasks 123 71 runs-on: ubuntu-latest 72 permissions: 73 actions: write 124 74 needs: [ php-compatibility, slack-notifications ] 125 75 if: |
Note: See TracChangeset
for help on using the changeset viewer.