Changeset 58330 for branches/6.1/.github/workflows/coding-standards.yml
- Timestamp:
- 06/04/2024 01:26:19 PM (12 months ago)
- Location:
- branches/6.1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.1
- Property svn:mergeinfo changed
/trunk merged: 56113-56114,57124-57125,57249,57918,58157
- Property svn:mergeinfo changed
-
branches/6.1/.github/workflows/coding-standards.yml
r55489 r58330 41 41 cancel-in-progress: true 42 42 43 # Disable permissions for all available scopes by default. 44 # Any needed permissions should be configured at the job level. 45 permissions: {} 46 43 47 jobs: 44 48 # Runs PHP coding standards checks. 45 #46 # Violations are reported inline with annotations.47 #48 # Performs the following steps:49 # - Checks out the repository.50 # - Sets up PHP.51 # - Configures caching for PHPCS scans.52 # - Installs Composer dependencies.53 # - Make Composer packages available globally.54 # - Runs PHPCS on the full codebase with warnings suppressed.55 # - Generate a report for displaying issues as pull request annotations.56 # - Runs PHPCS on the `tests` directory without warnings suppressed.57 # - Generate a report for displaying `test` directory issues as pull request annotations.58 # - Ensures version-controlled files are not modified or deleted.59 49 phpcs: 60 50 name: PHP coding standards 61 runs-on: ubuntu-latest 62 timeout-minutes: 20 51 uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-php.yml@trunk 52 permissions: 53 contents: read 63 54 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 64 65 steps: 66 - name: Checkout repository 67 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 68 69 - name: Set up PHP 70 uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0 71 with: 72 php-version: '7.4' 73 coverage: none 74 tools: cs2pr 75 76 # This date is used to ensure that the PHPCS cache is cleared at least once every week. 77 # http://man7.org/linux/man-pages/man1/date.1.html 78 - name: "Get last Monday's date" 79 id: get-date 80 run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT 81 82 - name: Cache PHPCS scan cache 83 uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6 84 with: 85 path: .cache/phpcs.json 86 key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }} 87 88 # Since Composer dependencies are installed using `composer update` and no lock file is in version control, 89 # passing a custom cache suffix ensures that the cache is flushed at least once per week. 90 - name: Install Composer dependencies 91 uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0 92 with: 93 custom-cache-suffix: ${{ steps.get-date.outputs.date }} 94 95 - name: Make Composer packages available globally 96 run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH 97 98 - name: Run PHPCS on all Core files 99 id: phpcs-core 100 run: phpcs -n --report-full --report-checkstyle=./.cache/phpcs-report.xml 101 102 - name: Show PHPCS results in PR 103 if: ${{ always() && steps.phpcs-core.outcome == 'failure' }} 104 run: cs2pr ./.cache/phpcs-report.xml 105 106 - name: Check test suite files for warnings 107 id: phpcs-tests 108 run: phpcs tests --report-full --report-checkstyle=./.cache/phpcs-tests-report.xml 109 110 - name: Show test suite scan results in PR 111 if: ${{ always() && steps.phpcs-tests.outcome == 'failure' }} 112 run: cs2pr ./.cache/phpcs-tests-report.xml 113 114 - name: Ensure version-controlled files are not modified during the tests 115 run: git diff --exit-code 55 with: 56 php-version: '7.4' 116 57 117 58 # Runs the JavaScript coding standards checks. 118 #119 # JSHint violations are not currently reported inline with annotations.120 #121 # Performs the following steps:122 # - Checks out the repository.123 # - Sets up Node.js.124 # - Logs debug information about the GitHub Action runner.125 # - Installs npm dependencies.126 # - Run the WordPress JSHint checks.127 # - Ensures version-controlled files are not modified or deleted.128 59 jshint: 129 60 name: JavaScript coding standards 130 runs-on: ubuntu-latest 131 timeout-minutes: 20 61 uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk 62 permissions: 63 contents: read 132 64 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 133 env:134 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}135 136 steps:137 - name: Checkout repository138 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0139 140 - name: Set up Node.js141 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0142 with:143 node-version-file: '.nvmrc'144 cache: npm145 146 - name: Log debug information147 run: |148 npm --version149 node --version150 git --version151 svn --version152 153 - name: Install npm Dependencies154 run: npm ci155 156 - name: Run JSHint157 run: npm run grunt jshint158 159 - name: Ensure version-controlled files are not modified or deleted160 run: git diff --exit-code161 65 162 66 slack-notifications: 163 67 name: Slack Notifications 164 68 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 69 permissions: 70 actions: read 71 contents: read 165 72 needs: [ phpcs, jshint ] 166 73 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} … … 176 83 name: Failed workflow tasks 177 84 runs-on: ubuntu-latest 85 permissions: 86 actions: write 178 87 needs: [ phpcs, jshint, slack-notifications ] 179 88 if: |
Note: See TracChangeset
for help on using the changeset viewer.