Make WordPress Core

Changeset 58301


Ignore:
Timestamp:
06/03/2024 05:34:55 PM (5 months ago)
Author:
desrosj
Message:

Build/Test Tools: Make use of new reusable workflows for 6.2.

This updates the 6.2 branch to utilize the new reusable workflows in trunk introduced in [58165].

This also includes backports for a some additional improvements and bug fixes that are necessary for the local development environment to continue working long term:

  • The image and platform properties for the mysql container have been updated to always prefer amd64 containers (#60822).
  • macos-13 is now pinned for MacOS jobs instead of macos-latest (#61340).
  • Removes the performance testing workflow. This workflow was overhauled in 6.4 to use Playwright. Continuing to support Puppeteer-based performance testing in 6.1-6.3 (which was historically very flaky) in a reusable workflow outweighs the benefit.
  • Migrating to Docker Compose V2 (#60901).
  • Removing the version property from docker-compose.yml (#59416).
  • Improvements to how artifacts and comments for Playground testing are generated.
  • Removing SVN related commands causing failures (#61216).
  • Updating the actions/github-scripts action to the latest version.

Merges [57918], [58157], [57124], [57125], [57249] to the 6.2 branch.

Props johnbillion, joemcgill, swissspidy, thelovekesh, narenin, mukesh27, JeffPaul, peterwilsoncc, zieladam, ockham, SergeyBiryukov, jorbin.
See #61340, #60822, #61216, #60901, #61101, #59416, #59805, #61213.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • branches/6.2/.github/workflows/test-build-processes.yml

    r58300 r58301  
    1 name: Test npm
     1name: Test Build Processes
    22
    33on:
     
    3434  cancel-in-progress: true
    3535
    36 env:
    37   PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
     36# Disable permissions for all available scopes by default.
     37# Any needed permissions should be configured at the job level.
     38permissions: {}
    3839
    3940jobs:
    40   # Verifies that installing npm dependencies and building WordPress works as expected.
    41   #
    42   # Performs the following steps:
    43   # - Checks out the repository.
    44   # - Sets up Node.js.
    45   # - Logs debug information about the GitHub Action runner.
    46   # - Installs npm dependencies.
    47   # - Builds WordPress to run from the `build` directory.
    48   # - Cleans up after building WordPress to the `build` directory.
    49   # - Ensures version-controlled files are not modified or deleted.
    50   # - Builds WordPress to run from the `src` directory.
    51   # - Cleans up after building WordPress to the `src` directory.
    52   # - Ensures version-controlled files are not modified or deleted.
    53   test-npm:
    54     name: Test npm on ${{ matrix.os }}
    55     runs-on: ${{ matrix.os }}
    56     timeout-minutes: 20
     41  # Tests the WordPress Core build process on multiple operating systems.
     42  test-core-build-process:
     43    name: Core running from ${{ matrix.directory }}
     44    uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@trunk
     45    permissions:
     46      contents: read
    5747    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    5848    strategy:
     
    6050      matrix:
    6151        os: [ ubuntu-latest, windows-latest ]
     52        directory: [ 'src', 'build' ]
     53    with:
     54      os: ${{ matrix.os }}
     55      directory: ${{ matrix.directory }}
     56      test-emoji: false
    6257
    63     steps:
    64       - name: Checkout repository
    65         uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    66 
    67       - name: Set up Node.js
    68         uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    69         with:
    70           node-version-file: '.nvmrc'
    71           cache: npm
    72 
    73       - name: Log debug information
    74         run: |
    75           npm --version
    76           node --version
    77           curl --version
    78           git --version
    79           svn --version
    80 
    81       - name: Install npm Dependencies
    82         run: npm ci
    83 
    84       - name: Build WordPress in /src
    85         run: npm run build:dev
    86 
    87       - name: Clean after building in /src
    88         run: npm run grunt clean -- --dev
    89 
    90       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    91         run: git diff --exit-code
    92 
    93       - name: Build WordPress
    94         run: npm run build
    95 
    96       - name: Clean after building
    97         run: npm run grunt clean
    98 
    99       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    100         run: git diff --exit-code
    101 
    102   # Verifies that installing npm dependencies and building WordPress works as expected on MacOS.
     58  # Tests the WordPress Core build process on MacOS.
    10359  #
    104   # This is separate from the job above in order to use stricter conditions about when to run.
     60  # This is separate from the job above in order to use stricter conditions when determining when to run.
    10561  # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate.
    10662  #
     
    10864  # currently no way to determine the OS being used on a given job.
    10965  # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
    110   #
    111   # Performs the following steps:
    112   # - Checks out the repository.
    113   # - Sets up Node.js.
    114   # - Logs debug information about the GitHub Action runner.
    115   # - Installs npm dependencies.
    116   # - Builds WordPress to run from the `build` directory.
    117   # - Cleans up after building WordPress to the `build` directory.
    118   # - Ensures version-controlled files are not modified or deleted.
    119   # - Builds WordPress to run from the `src` directory.
    120   # - Cleans up after building WordPress to the `src` directory.
    121   # - Ensures version-controlled files are not modified or deleted.
    122   test-npm-macos:
    123     name: Test npm on MacOS
    124     runs-on: macos-latest
    125     timeout-minutes: 30
     66  test-core-build-process-macos:
     67    name: Core running from ${{ matrix.directory }}
     68    uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@trunk
     69    permissions:
     70      contents: read
    12671    if: ${{ github.repository == 'WordPress/wordpress-develop' }}
    127     steps:
    128       - name: Checkout repository
    129         uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    130 
    131       - name: Set up Node.js
    132         uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    133         with:
    134           node-version-file: '.nvmrc'
    135           cache: npm
    136 
    137       - name: Log debug information
    138         run: |
    139           npm --version
    140           node --version
    141           curl --version
    142           git --version
    143           svn --version
    144 
    145       - name: Install npm Dependencies
    146         run: npm ci
    147 
    148       - name: Build WordPress in /src
    149         run: npm run build:dev
    150 
    151       - name: Clean after building in /src
    152         run: npm run grunt clean -- --dev
    153 
    154       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    155         run: git diff --exit-code
    156 
    157       - name: Build WordPress
    158         run: npm run build
    159 
    160       - name: Clean after building
    161         run: npm run grunt clean
    162 
    163       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    164         run: git diff --exit-code
     72    strategy:
     73      fail-fast: false
     74      matrix:
     75        os: [ macos-13 ]
     76        directory: [ 'src', 'build' ]
     77    with:
     78      os: ${{ matrix.os }}
     79      directory: ${{ matrix.directory }}
     80      test-emoji: false
    16581
    16682  slack-notifications:
    16783    name: Slack Notifications
    16884    uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
    169     needs: [ test-npm, test-npm-macos ]
     85    permissions:
     86      actions: read
     87      contents: read
     88    needs: [ test-core-build-process, test-core-build-process-macos ]
    17089    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
    17190    with:
    172       calling_status: ${{ needs.test-npm.result == 'success' && needs.test-npm-macos.result == 'success' && 'success' || ( needs.test-npm.result == 'cancelled' || needs.test-npm-macos.result == 'cancelled' ) && 'cancelled' || 'failure' }}
     91      calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
    17392    secrets:
    17493      SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
     
    18099    name: Failed workflow tasks
    181100    runs-on: ubuntu-latest
    182     needs: [ test-npm, test-npm-macos, slack-notifications ]
     101    permissions:
     102      actions: write
     103    needs: [ slack-notifications ]
    183104    if: |
    184105      always() &&
     
    187108      github.run_attempt < 2 &&
    188109      (
    189         needs.test-npm.result == 'cancelled' || needs.test-npm.result == 'failure' ||
    190         needs.test-npm-macos.result == 'cancelled' || needs.test-npm-macos.result == 'failure'
     110        contains( needs.*.result, 'cancelled' ) ||
     111        contains( needs.*.result, 'failure' )
    191112      )
    192113
    193114    steps:
    194115      - name: Dispatch workflow run
    195         uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     116        uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
    196117        with:
    197118          retries: 2
Note: See TracChangeset for help on using the changeset viewer.