WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/12/2021 07:16:28 PM (10 months ago)
Author:
desrosj
Message:

Build/Test Tools: Restore automated testing in the 5.1 branch.

This commit merges the workflow files required to run automated testing on GitHub Actions.

In addition, [49836] and [50285] have been included in order to keep the local Docker environment consistent across all branches.

Merges [49162,49168-49169,49175,49204,49227-49228,49244,49369,49371,49548,49781-49784,49786,49836,49938,50268,50285,50298] to the 5.1 branch.
See #50401.

Location:
branches/5.1
Files:
1 added
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/5.1

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

    r49162 r50306  
    55    branches:
    66      - master
     7      # JSHint was introduced in WordPress 3.8.
    78      # PHPCS checking was introduced in WordPress 5.1.
    8       - '5.[1-9]'
    9       - '[6-9].*'
     9      - '3.[89]'
     10      - '[4-9].[0-9]'
     11    tags:
     12      - '3.[89]*'
     13      - '[4-9].[0-9]*'
    1014  pull_request:
    1115
     
    1721  # Performs the following steps:
    1822  # - Checks out the repository.
    19   # - Configures caching for Composer.
    2023  # - Sets up PHP.
    2124  # - Logs debug information.
    22   # - Installs Composer dependencies (from cache if possible).
     25  # - Installs Composer dependencies (use cache if possible).
     26  # - Make Composer packages available globally.
    2327  # - Logs PHP_CodeSniffer debug information.
    2428  # - Runs PHPCS on the full codebase with warnings suppressed.
     
    2832    name: PHP coding standards
    2933    runs-on: ubuntu-latest
     34    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     35
    3036    steps:
    3137      - name: Checkout repository
    3238        uses: actions/checkout@v2
    3339
    34       - name: Get Composer cache directory
    35         id: composer-cache
    36         run: echo "::set-output name=dir::$(composer config cache-files-dir)"
    37 
    38       - name: Set up Composer caching
    39         uses: actions/cache@v2
    40         env:
    41           cache-name: cache-composer-dependencies
    42         with:
    43           path: ${{ steps.composer-cache.outputs.dir }}
    44           key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
    45           restore-keys: |
    46             ${{ runner.os }}-composer-
    47 
    4840      - name: Set up PHP
    4941        uses: shivammathur/setup-php@v2
    5042        with:
    51           php-version: '7.4'
     43          php-version: '7.2'
    5244          coverage: none
    5345          tools: composer, cs2pr
     
    5951
    6052      - name: Install Composer dependencies
    61         run: |
    62           composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction
    63           echo "vendor/bin" >> $GITHUB_PATH
     53        uses: ramsey/composer-install@v1
     54        with:
     55          composer-options: "--no-progress --no-ansi --no-interaction"
     56
     57      - name: Make Composer packages available globally
     58        run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
    6459
    6560      - name: Log PHPCS debug information
    6661        run: phpcs -i
    6762
    68       - name: Run PHPCS on all Core files
    69         run: vendor/bin/phpcs -q -n --report=checkstyle | cs2pr
    70 
    71       - name: Check test suite files for warnings
    72         run: vendor/bin/phpcs tests -q --report=checkstyle | cs2pr
     63      - name: Run PHPCBF on all Core files
     64        run: phpcbf
    7365
    7466  # Runs the JavaScript coding standards checks.
     67  #
     68  # JSHint violations are not currently reported inline with annotations.
    7569  #
    7670  # Performs the following steps:
    7771  # - Checks out the repository.
    7872  # - Logs debug information about the runner container.
    79   # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches)
     73  # - Installs NodeJS 14.
    8074  # - Sets up caching for NPM.
    8175  # - Logs updated debug information.
    82   # _ Installs NPM dependencies.
     76  # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
    8377  # - Run the WordPress JSHint checks.
    8478  # - todo: Configure Slack notifications for failing tests.
     
    8680    name: JavaScript coding standards
    8781    runs-on: ubuntu-latest
     82    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     83    env:
     84      PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
     85
    8886    steps:
    8987      - name: Checkout repository
     
    10098        uses: actions/setup-node@v1
    10199        with:
    102           node-version: 12
     100          node-version: 14
    103101
    104102      - name: Cache NodeJS modules
     
    119117
    120118      - name: Install Dependencies
    121         run: npm ci
     119        run: npx install-changed --install-command="npm ci"
    122120
    123121      - name: Run JSHint
Note: See TracChangeset for help on using the changeset viewer.