Make WordPress Core


Ignore:
Timestamp:
06/03/2024 05:36:35 PM (6 months ago)
Author:
desrosj
Message:

Build/Test Tools: Include files missed in [58301].

Unprops desrosj.
See #61340, #60822, #61216, #60901, #61101, #59416, #59805, #61213.

Location:
branches/6.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.2

  • branches/6.2/.github/workflows/coding-standards.yml

    r55487 r58302  
    4141  cancel-in-progress: true
    4242
     43# Disable permissions for all available scopes by default.
     44# Any needed permissions should be configured at the job level.
     45permissions: {}
     46
    4347jobs:
    4448  # 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.
    5949  phpcs:
    6050    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
    6354    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: |
    86             .cache/phpcs-src.json
    87             .cache/phpcs-tests.json
    88           key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }}
    89 
    90       # Since Composer dependencies are installed using `composer update` and no lock file is in version control,
    91       # passing a custom cache suffix ensures that the cache is flushed at least once per week.
    92       - name: Install Composer dependencies
    93         uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
    94         with:
    95           custom-cache-suffix: ${{ steps.get-date.outputs.date }}
    96 
    97       - name: Make Composer packages available globally
    98         run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
    99 
    100       - name: Run PHPCS on all Core files
    101         id: phpcs-core
    102         run: phpcs -n --report-full --cache=./.cache/phpcs-src.json --report-checkstyle=./.cache/phpcs-report.xml
    103 
    104       - name: Show PHPCS results in PR
    105         if: ${{ always() && steps.phpcs-core.outcome == 'failure' }}
    106         run: cs2pr ./.cache/phpcs-report.xml
    107 
    108       - name: Check test suite files for warnings
    109         id: phpcs-tests
    110         run: phpcs tests --report-full --cache=./.cache/phpcs-tests.json --report-checkstyle=./.cache/phpcs-tests-report.xml
    111 
    112       - name: Show test suite scan results in PR
    113         if: ${{ always() && steps.phpcs-tests.outcome == 'failure' }}
    114         run: cs2pr ./.cache/phpcs-tests-report.xml
    115 
    116       - name: Ensure version-controlled files are not modified during the tests
    117         run: git diff --exit-code
     55    with:
     56      php-version: '7.4'
    11857
    11958  # Runs the JavaScript coding standards checks.
    120   #
    121   # JSHint violations are not currently reported inline with annotations.
    122   #
    123   # Performs the following steps:
    124   # - Checks out the repository.
    125   # - Sets up Node.js.
    126   # - Logs debug information about the GitHub Action runner.
    127   # - Installs npm dependencies.
    128   # - Run the WordPress JSHint checks.
    129   # - Ensures version-controlled files are not modified or deleted.
    13059  jshint:
    13160    name: JavaScript coding standards
    132     runs-on: ubuntu-latest
    133     timeout-minutes: 20
     61    uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk
     62    permissions:
     63      contents: read
    13464    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    135     env:
    136       PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
    137 
    138     steps:
    139       - name: Checkout repository
    140         uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    141 
    142       - name: Set up Node.js
    143         uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    144         with:
    145           node-version-file: '.nvmrc'
    146           cache: npm
    147 
    148       - name: Log debug information
    149         run: |
    150           npm --version
    151           node --version
    152           git --version
    153           svn --version
    154 
    155       - name: Install npm Dependencies
    156         run: npm ci
    157 
    158       - name: Run JSHint
    159         run: npm run grunt jshint
    160 
    161       - name: Ensure version-controlled files are not modified or deleted
    162         run: git diff --exit-code
    16365
    16466  slack-notifications:
    16567    name: Slack Notifications
    16668    uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
     69    permissions:
     70      actions: read
     71      contents: read
    16772    needs: [ phpcs, jshint ]
    16873    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
     
    17883    name: Failed workflow tasks
    17984    runs-on: ubuntu-latest
     85    permissions:
     86      actions: write
    18087    needs: [ phpcs, jshint, slack-notifications ]
    18188    if: |
Note: See TracChangeset for help on using the changeset viewer.