Make WordPress Core


Ignore:
Timestamp:
06/03/2024 05:00:05 PM (20 months ago)
Author:
desrosj
Message:

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

This updates the 6.3 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.3 branch.

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

Location:
branches/6.3
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/6.3

  • branches/6.3/.github/workflows/test-build-processes.yml

    r58299 r58300  
    1 name: Test npm
     1name: Test Build Processes
    22
    33on:
     
    3838permissions: {}
    3939
    40 env:
    41   PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
    42 
    4340jobs:
    44   # Verifies that installing npm dependencies and building WordPress works as expected.
    45   #
    46   # Performs the following steps:
    47   # - Checks out the repository.
    48   # - Sets up Node.js.
    49   # - Logs debug information about the GitHub Action runner.
    50   # - Installs npm dependencies.
    51   # - Builds WordPress to run from the `build` directory.
    52   # - Cleans up after building WordPress to the `build` directory.
    53   # - Ensures version-controlled files are not modified or deleted.
    54   # - Builds WordPress to run from the `src` directory.
    55   # - Cleans up after building WordPress to the `src` directory.
    56   # - Ensures version-controlled files are not modified or deleted.
    57   test-npm:
    58     name: Test npm on ${{ matrix.os }}
    59     runs-on: ${{ matrix.os }}
     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
    6045    permissions:
    6146      contents: read
    62     timeout-minutes: 20
    6347    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    6448    strategy:
     
    6650      matrix:
    6751        os: [ ubuntu-latest, windows-latest ]
     52        directory: [ 'src', 'build' ]
     53    with:
     54      os: ${{ matrix.os }}
     55      directory: ${{ matrix.directory }}
     56      test-emoji: false
    6857
    69     steps:
    70       - name: Checkout repository
    71         uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    72 
    73       - name: Set up Node.js
    74         uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    75         with:
    76           node-version-file: '.nvmrc'
    77           cache: npm
    78 
    79       - name: Log debug information
    80         run: |
    81           npm --version
    82           node --version
    83           curl --version
    84           git --version
    85           svn --version
    86 
    87       - name: Install npm Dependencies
    88         run: npm ci
    89 
    90       - name: Build WordPress in /src
    91         run: npm run build:dev
    92 
    93       - name: Clean after building in /src
    94         run: npm run grunt clean -- --dev
    95 
    96       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    97         run: git diff --exit-code
    98 
    99       - name: Build WordPress
    100         run: npm run build
    101 
    102       - name: Clean after building
    103         run: npm run grunt clean
    104 
    105       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    106         run: git diff --exit-code
    107 
    108   # Verifies that installing npm dependencies and building WordPress works as expected on MacOS.
     58  # Tests the WordPress Core build process on MacOS.
    10959  #
    110   # 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.
    11161  # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate.
    11262  #
     
    11464  # currently no way to determine the OS being used on a given job.
    11565  # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
    116   #
    117   # Performs the following steps:
    118   # - Checks out the repository.
    119   # - Sets up Node.js.
    120   # - Logs debug information about the GitHub Action runner.
    121   # - Installs npm dependencies.
    122   # - Builds WordPress to run from the `build` directory.
    123   # - Cleans up after building WordPress to the `build` directory.
    124   # - Ensures version-controlled files are not modified or deleted.
    125   # - Builds WordPress to run from the `src` directory.
    126   # - Cleans up after building WordPress to the `src` directory.
    127   # - Ensures version-controlled files are not modified or deleted.
    128   test-npm-macos:
    129     name: Test npm on MacOS
    130     runs-on: macos-latest
     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
    13169    permissions:
    13270      contents: read
    133     timeout-minutes: 30
    13471    if: ${{ github.repository == 'WordPress/wordpress-develop' }}
    135     steps:
    136       - name: Checkout repository
    137         uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    138 
    139       - name: Set up Node.js
    140         uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    141         with:
    142           node-version-file: '.nvmrc'
    143           cache: npm
    144 
    145       - name: Log debug information
    146         run: |
    147           npm --version
    148           node --version
    149           curl --version
    150           git --version
    151           svn --version
    152 
    153       - name: Install npm Dependencies
    154         run: npm ci
    155 
    156       - name: Build WordPress in /src
    157         run: npm run build:dev
    158 
    159       - name: Clean after building in /src
    160         run: npm run grunt clean -- --dev
    161 
    162       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    163         run: git diff --exit-code
    164 
    165       - name: Build WordPress
    166         run: npm run build
    167 
    168       - name: Clean after building
    169         run: npm run grunt clean
    170 
    171       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    172         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
    17381
    17482  slack-notifications:
     
    17886      actions: read
    17987      contents: read
    180     needs: [ test-npm, test-npm-macos ]
     88    needs: [ test-core-build-process, test-core-build-process-macos ]
    18189    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
    18290    with:
    183       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' }}
    18492    secrets:
    18593      SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
     
    193101    permissions:
    194102      actions: write
    195     needs: [ test-npm, test-npm-macos, slack-notifications ]
     103    needs: [ slack-notifications ]
    196104    if: |
    197105      always() &&
     
    200108      github.run_attempt < 2 &&
    201109      (
    202         needs.test-npm.result == 'cancelled' || needs.test-npm.result == 'failure' ||
    203         needs.test-npm-macos.result == 'cancelled' || needs.test-npm-macos.result == 'failure'
     110        contains( needs.*.result, 'cancelled' ) ||
     111        contains( needs.*.result, 'failure' )
    204112      )
    205113
    206114    steps:
    207115      - name: Dispatch workflow run
    208         uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     116        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    209117        with:
    210118          retries: 2
Note: See TracChangeset for help on using the changeset viewer.