Make WordPress Core


Ignore:
Timestamp:
07/06/2021 06:36:46 PM (4 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Add assertions to ensure version-controlled files are not modified during CI, and fix the grunt clean command.

Some tests and some commands that run during the build steps modify files that are under version control. This adds assertions to ensure that these files don't remain in a modified state after the test runs on CI.

This also fixes the grunt clean command which erroneously deletes script-loader-packages.php. This file is re-populated during the build, but deleting it during the clean is undesirable.

Fixes #53606

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/test-npm.yml

    r51341 r51355  
    4646  # - Builds WordPress to run from the `build` directory.
    4747  # - Cleans up after building WordPress to the `build` directory.
     48  # - Ensures version-controlled files are not modified or deleted.
    4849  # - Builds WordPress to run from the `src` directory.
    4950  # - Cleans up after building WordPress to the `src` directory.
     51  # - Ensures version-controlled files are not modified or deleted.
    5052  test-npm:
    5153    name: Test NPM on ${{ matrix.os }}
     
    8486        run: npm run grunt clean
    8587
     88      - name: Ensure version-controlled files are not modified or deleted during building and cleaning
     89        run: git diff --exit-code
     90
    8691      - name: Build WordPress in /src
    8792        run: npm run build:dev
     
    8994      - name: Clean after building in /src
    9095        run: npm run grunt clean -- --dev
     96
     97      - name: Ensure version-controlled files are not modified or deleted during building and cleaning
     98        run: git diff --exit-code
    9199
    92100  # Verifies that installing NPM dependencies and building WordPress works as expected on MacOS.
     
    101109  # - Builds WordPress to run from the `build` directory.
    102110  # - Cleans up after building WordPress to the `build` directory.
     111  # - Ensures version-controlled files are not modified or deleted.
    103112  # - Builds WordPress to run from the `src` directory.
    104113  # - Cleans up after building WordPress to the `src` directory.
     114  # - Ensures version-controlled files are not modified or deleted.
    105115  test-npm-macos:
    106116    name: Test NPM on MacOS
     
    134144        run: npm run grunt clean
    135145
     146      - name: Ensure version-controlled files are not modified or deleted during building and cleaning
     147        run: git diff --exit-code
     148
    136149      - name: Build WordPress in /src
    137150        run: npm run build:dev
     
    139152      - name: Clean after building in /src
    140153        run: npm run grunt clean -- --dev
     154
     155      - name: Ensure version-controlled files are not modified or deleted during building and cleaning
     156        run: git diff --exit-code
Note: See TracChangeset for help on using the changeset viewer.