Changeset 58358 for branches/5.9/.github/workflows/coding-standards.yml
- Timestamp:
- 06/06/2024 04:34:11 PM (6 months ago)
- Location:
- branches/5.9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.9
- Property svn:mergeinfo changed
/trunk merged: 53552,53895,56113-56114,57124-57125,57249,57918,58157
- Property svn:mergeinfo changed
-
branches/5.9/.github/workflows/coding-standards.yml
r55516 r58358 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 # - Logs debug information.52 # - Configures caching for PHPCS scans.53 # - Installs Composer dependencies (use cache if possible).54 # - Make Composer packages available globally.55 # - Logs PHP_CodeSniffer debug information.56 # - Runs PHPCS on the full codebase with warnings suppressed.57 # - Runs PHPCS on the `tests` directory without warnings suppressed.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: composer, cs2pr 75 76 - name: Log debug information 77 run: | 78 php --version 79 composer --version 80 81 # This date is used to ensure that the PHPCS cache is cleared at least once every week. 82 # http://man7.org/linux/man-pages/man1/date.1.html 83 - name: "Get last Monday's date" 84 id: get-date 85 run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT 86 87 - name: Cache PHPCS scan cache 88 uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6 89 with: 90 path: .cache/phpcs.json 91 key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }} 92 93 - name: Install Composer dependencies 94 uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0 95 with: 96 composer-options: "--no-progress --no-ansi" 97 98 - name: Make Composer packages available globally 99 run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH 100 101 - name: Log PHPCS debug information 102 run: phpcs -i 103 104 - name: Run PHPCS on all Core files 105 run: phpcs -q -n --report=checkstyle | cs2pr 106 107 - name: Check test suite files for warnings 108 run: phpcs tests -q --report=checkstyle | cs2pr 109 110 - name: Ensure version-controlled files are not modified during the tests 111 run: git diff --exit-code 55 with: 56 php-version: '7.4' 112 57 113 58 # Runs the JavaScript coding standards checks. 114 #115 # JSHint violations are not currently reported inline with annotations.116 #117 # Performs the following steps:118 # - Checks out the repository.119 # - Logs debug information about the GitHub Action runner.120 # - Installs Node.js.121 # - Logs updated debug information.122 # _ Installs npm dependencies.123 # - Run the WordPress JSHint checks.124 # - Ensures version-controlled files are not modified or deleted.125 59 jshint: 126 60 name: JavaScript coding standards 127 runs-on: ubuntu-latest 128 timeout-minutes: 20 61 uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk 62 permissions: 63 contents: read 129 64 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 130 env:131 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}132 133 steps:134 - name: Checkout repository135 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0136 137 - name: Log debug information138 run: |139 npm --version140 node --version141 git --version142 svn --version143 144 - name: Install Node.js145 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0146 with:147 node-version-file: '.nvmrc'148 cache: npm149 150 - name: Log debug information151 run: |152 npm --version153 node --version154 155 - name: Install Dependencies156 run: npm ci157 158 - name: Run JSHint159 run: npm run grunt jshint160 161 - name: Ensure version-controlled files are not modified or deleted162 run: git diff --exit-code163 65 164 66 slack-notifications: 165 67 name: Slack Notifications 166 68 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 69 permissions: 70 actions: read 71 contents: read 167 72 needs: [ phpcs, jshint ] 168 73 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} … … 178 83 name: Failed workflow tasks 179 84 runs-on: ubuntu-latest 85 permissions: 86 actions: write 180 87 needs: [ phpcs, jshint, slack-notifications ] 181 88 if: |
Note: See TracChangeset
for help on using the changeset viewer.