Changeset 58276 for branches/6.4/.github/workflows/coding-standards.yml
- Timestamp:
- 05/31/2024 07:23:44 PM (11 months ago)
- Location:
- branches/6.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.4
- Property svn:mergeinfo changed
/trunk merged: 57124-57125,57249,57918,58157
- Property svn:mergeinfo changed
-
branches/6.4/.github/workflows/coding-standards.yml
r57002 r58276 47 47 jobs: 48 48 # Runs PHP coding standards checks. 49 #50 # Violations are reported inline with annotations.51 #52 # Performs the following steps:53 # - Checks out the repository.54 # - Sets up PHP.55 # - Configures caching for PHPCS scans.56 # - Installs Composer dependencies.57 # - Make Composer packages available globally.58 # - Runs PHPCS on the full codebase with warnings suppressed.59 # - Generate a report for displaying issues as pull request annotations.60 # - Runs PHPCS on the `tests` directory without warnings suppressed.61 # - Generate a report for displaying `test` directory issues as pull request annotations.62 # - Ensures version-controlled files are not modified or deleted.63 49 phpcs: 64 50 name: PHP coding standards 65 runs-on: ubuntu-latest51 uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-php.yml@trunk 66 52 permissions: 67 53 contents: read 68 timeout-minutes: 2069 54 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 70 55 71 steps:72 - name: Checkout repository73 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.074 with:75 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}76 77 - name: Set up PHP78 uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2.25.479 with:80 php-version: 'latest'81 coverage: none82 tools: cs2pr83 84 # This date is used to ensure that the PHPCS cache is cleared at least once every week.85 # http://man7.org/linux/man-pages/man1/date.1.html86 - name: "Get last Monday's date"87 id: get-date88 run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT89 90 - name: Cache PHPCS scan cache91 uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.192 with:93 path: |94 .cache/phpcs-src.json95 .cache/phpcs-tests.json96 key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }}97 98 # Since Composer dependencies are installed using `composer update` and no lock file is in version control,99 # passing a custom cache suffix ensures that the cache is flushed at least once per week.100 - name: Install Composer dependencies101 uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0102 with:103 custom-cache-suffix: ${{ steps.get-date.outputs.date }}104 105 - name: Make Composer packages available globally106 run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH107 108 - name: Run PHPCS on all Core files109 id: phpcs-core110 run: phpcs -n --report-full --cache=./.cache/phpcs-src.json --report-checkstyle=./.cache/phpcs-report.xml111 112 - name: Show PHPCS results in PR113 if: ${{ always() && steps.phpcs-core.outcome == 'failure' }}114 run: cs2pr ./.cache/phpcs-report.xml115 116 - name: Check test suite files for warnings117 id: phpcs-tests118 run: phpcs tests --report-full --cache=./.cache/phpcs-tests.json --report-checkstyle=./.cache/phpcs-tests-report.xml119 120 - name: Show test suite scan results in PR121 if: ${{ always() && steps.phpcs-tests.outcome == 'failure' }}122 run: cs2pr ./.cache/phpcs-tests-report.xml123 124 - name: Ensure version-controlled files are not modified during the tests125 run: git diff --exit-code126 127 56 # Runs the JavaScript coding standards checks. 128 #129 # JSHint violations are not currently reported inline with annotations.130 #131 # Performs the following steps:132 # - Checks out the repository.133 # - Sets up Node.js.134 # - Logs debug information about the GitHub Action runner.135 # - Installs npm dependencies.136 # - Run the WordPress JSHint checks.137 # - Ensures version-controlled files are not modified or deleted.138 57 jshint: 139 58 name: JavaScript coding standards 140 runs-on: ubuntu-latest59 uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk 141 60 permissions: 142 61 contents: read 143 timeout-minutes: 20144 62 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 145 env:146 PUPPETEER_SKIP_DOWNLOAD: ${{ true }}147 148 steps:149 - name: Checkout repository150 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0151 with:152 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}153 154 - name: Set up Node.js155 uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1156 with:157 node-version-file: '.nvmrc'158 cache: npm159 160 - name: Log debug information161 run: |162 npm --version163 node --version164 git --version165 svn --version166 167 - name: Install npm Dependencies168 run: npm ci169 170 - name: Run JSHint171 run: npm run grunt jshint172 173 - name: Ensure version-controlled files are not modified or deleted174 run: git diff --exit-code175 63 176 64 slack-notifications: … … 208 96 steps: 209 97 - name: Dispatch workflow run 210 uses: actions/github-script@ d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.198 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 211 99 with: 212 100 retries: 2
Note: See TracChangeset
for help on using the changeset viewer.