Make WordPress Core


Ignore:
Timestamp:
06/28/2024 06:40:36 PM (11 months ago)
Author:
desrosj
Message:

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

This updates the 5.8 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).
  • Run E2E tests with and without SCRIPT_DEBUG (#58661).
  • 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.
  • Move the Memcached container into the Docker Compose config (#55700).
  • Configure Xdebug modes in the local Docker environment (#56022).
  • Cache the results of PHP_CodeSniffer runs (#49783).

Merges [52179], [53895], [53552], [56113], [56114], [57918], [58157], [57124], [57125], [57249] to the 5.8 branch.

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

Location:
branches/5.8
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/5.8

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

    r58596 r58597  
    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   # - Logs debug information about the GitHub Action runner.
    45   # - Installs Node.js.
    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        include:
     54          # Only prepare artifacts once.
     55          - os: ubuntu-latest
     56            directory: 'build'
     57            prepare-playground: true
     58    with:
     59      os: ${{ matrix.os }}
     60      directory: ${{ matrix.directory }}
     61      prepare-playground: ${{ matrix.prepare-playground && matrix.prepare-playground || false }}
     62      test-emoji: false
    6263
    63     steps:
    64       - name: Checkout repository
    65         uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    66 
    67       - name: Log debug information
    68         run: |
    69           npm --version
    70           node --version
    71           curl --version
    72           git --version
    73           svn --version
    74 
    75       - name: Install Node.js
    76         uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    77         with:
    78           node-version-file: '.nvmrc'
    79           cache: npm
    80 
    81       - name: Install Dependencies
    82         run: npm ci
    83 
    84       - name: Build WordPress
    85         run: npm run build
    86 
    87       - name: Clean after building
    88         run: npm run grunt clean
    89 
    90       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    91         run: git diff --exit-code
    92 
    93   # Verifies that installing npm dependencies and building WordPress works as expected on MacOS.
     64  # Tests the WordPress Core build process on MacOS.
    9465  #
    95   # This is separate from the job above in order to use stricter conditions about when to run.
     66  # This is separate from the job above in order to use stricter conditions when determining when to run.
    9667  # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate.
    9768  #
     
    9970  # currently no way to determine the OS being used on a given job.
    10071  # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
    101   #
    102   # Performs the following steps:
    103   # - Checks out the repository.
    104   # - Logs debug information about the GitHub Action runner.
    105   # - Installs Node.js.
    106   # _ Installs npm dependencies.
    107   # - Builds WordPress to run from the `build` directory.
    108   # - Cleans up after building WordPress to the `build` directory.
    109   # - Ensures version-controlled files are not modified or deleted.
    110   # - Builds WordPress to run from the `src` directory.
    111   # - Cleans up after building WordPress to the `src` directory.
    112   # - Ensures version-controlled files are not modified or deleted.
    113   test-npm-macos:
    114     name: Test npm on MacOS
    115     runs-on: macos-latest
    116     timeout-minutes: 30
     72  test-core-build-process-macos:
     73    name: Core running from ${{ matrix.directory }}
     74    uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@trunk
     75    permissions:
     76      contents: read
    11777    if: ${{ github.repository == 'WordPress/wordpress-develop' }}
    118     steps:
    119       - name: Checkout repository
    120         uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    121 
    122       - name: Log debug information
    123         run: |
    124           npm --version
    125           node --version
    126           curl --version
    127           git --version
    128           svn --version
    129 
    130       - name: Install Node.js
    131         uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    132         with:
    133           node-version-file: '.nvmrc'
    134           cache: npm
    135 
    136       - name: Install Dependencies
    137         run: npm ci
    138 
    139       - name: Build WordPress
    140         run: npm run build
    141 
    142       - name: Clean after building
    143         run: npm run grunt clean
    144 
    145       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    146         run: git diff --exit-code
    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
     78    strategy:
     79      fail-fast: false
     80      matrix:
     81        os: [ macos-13 ]
     82        directory: [ 'src', 'build' ]
     83    with:
     84      os: ${{ matrix.os }}
     85      directory: ${{ matrix.directory }}
     86      test-emoji: false
    15687
    15788  slack-notifications:
    15889    name: Slack Notifications
    15990    uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
    160     needs: [ test-npm, test-npm-macos ]
     91    permissions:
     92      actions: read
     93      contents: read
     94    needs: [ test-core-build-process, test-core-build-process-macos ]
    16195    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
    16296    with:
    163       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' }}
     97      calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
    16498    secrets:
    16599      SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
     
    171105    name: Failed workflow tasks
    172106    runs-on: ubuntu-latest
    173     needs: [ test-npm, test-npm-macos, slack-notifications ]
     107    permissions:
     108      actions: write
     109    needs: [ slack-notifications ]
    174110    if: |
    175111      always() &&
     
    178114      github.run_attempt < 2 &&
    179115      (
    180         needs.test-npm.result == 'cancelled' || needs.test-npm.result == 'failure' ||
    181         needs.test-npm-macos.result == 'cancelled' || needs.test-npm-macos.result == 'failure'
     116        contains( needs.*.result, 'cancelled' ) ||
     117        contains( needs.*.result, 'failure' )
    182118      )
    183119
    184120    steps:
    185121      - name: Dispatch workflow run
    186         uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     122        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    187123        with:
    188124          retries: 2
Note: See TracChangeset for help on using the changeset viewer.