Make WordPress Core


Ignore:
Timestamp:
05/31/2024 07:23:44 PM (12 months ago)
Author:
desrosj
Message:

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

This updates the 6.4 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:

  • 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.4 branch.

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

Location:
branches/6.4
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/6.4

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

    r58275 r58276  
    1 name: Test npm
     1name: Test Build Processes
    22
    33on:
     
    3838permissions: {}
    3939
    40 env:
    41   PUPPETEER_SKIP_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        include:
     54          # Only prepare artifacts for Playground 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
    6863
    69     steps:
    70       - name: Checkout repository
    71         uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
    72         with:
    73           show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
    74 
    75       - name: Set up Node.js
    76         uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
    77         with:
    78           node-version-file: '.nvmrc'
    79           check-latest: true
    80           cache: npm
    81 
    82       - name: Log debug information
    83         run: |
    84           npm --version
    85           node --version
    86           curl --version
    87           git --version
    88           svn --version
    89 
    90       - name: Install npm Dependencies
    91         run: npm ci
    92 
    93       - name: Build WordPress in /src
    94         run: npm run build:dev
    95 
    96       - name: Clean after building in /src
    97         run: npm run grunt clean -- --dev
    98 
    99       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    100         run: git diff --exit-code
    101 
    102       - name: Build WordPress
    103         run: npm run build
    104 
    105       - name: Clean after building
    106         run: npm run grunt clean
    107 
    108       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    109         run: git diff --exit-code
    110 
    111   # Verifies that installing npm dependencies and building WordPress works as expected on MacOS.
     64  # Tests the WordPress Core build process on MacOS.
    11265  #
    113   # 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.
    11467  # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate.
    11568  #
     
    11770  # currently no way to determine the OS being used on a given job.
    11871  # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
    119   #
    120   # Performs the following steps:
    121   # - Checks out the repository.
    122   # - Sets up Node.js.
    123   # - Logs debug information about the GitHub Action runner.
    124   # - Installs npm dependencies.
    125   # - Builds WordPress to run from the `build` directory.
    126   # - Cleans up after building WordPress to the `build` directory.
    127   # - Ensures version-controlled files are not modified or deleted.
    128   # - Builds WordPress to run from the `src` directory.
    129   # - Cleans up after building WordPress to the `src` directory.
    130   # - Ensures version-controlled files are not modified or deleted.
    131   test-npm-macos:
    132     name: Test npm on MacOS
    133     runs-on: macos-latest
     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
    13475    permissions:
    13576      contents: read
    136     timeout-minutes: 30
    13777    if: ${{ github.repository == 'WordPress/wordpress-develop' }}
    138     steps:
    139       - name: Checkout repository
    140         uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
    141         with:
    142           show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
    143 
    144       - name: Set up Node.js
    145         uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
    146         with:
    147           node-version-file: '.nvmrc'
    148           check-latest: true
    149           cache: npm
    150 
    151       - name: Log debug information
    152         run: |
    153           npm --version
    154           node --version
    155           curl --version
    156           git --version
    157           svn --version
    158 
    159       - name: Install npm Dependencies
    160         run: npm ci
    161 
    162       - name: Build WordPress in /src
    163         run: npm run build:dev
    164 
    165       - name: Clean after building in /src
    166         run: npm run grunt clean -- --dev
    167 
    168       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    169         run: git diff --exit-code
    170 
    171       - name: Build WordPress
    172         run: npm run build
    173 
    174       - name: Clean after building
    175         run: npm run grunt clean
    176 
    177       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    178         run: git diff --exit-code
     78    strategy:
     79      fail-fast: false
     80      matrix:
     81        os: [ macos-latest ]
     82        directory: [ 'src', 'build' ]
     83    with:
     84      os: ${{ matrix.os }}
     85      directory: ${{ matrix.directory }}
     86      test-emoji: false
    17987
    18088  slack-notifications:
     
    18492      actions: read
    18593      contents: read
    186     needs: [ test-npm, test-npm-macos ]
     94    needs: [ test-core-build-process, test-core-build-process-macos ]
    18795    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
    18896    with:
     
    212120    steps:
    213121      - name: Dispatch workflow run
    214         uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
     122        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    215123        with:
    216124          retries: 2
Note: See TracChangeset for help on using the changeset viewer.