Make WordPress Core


Ignore:
Timestamp:
07/06/2021 07:12:23 PM (5 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.

Merges [51355] to the 5.8 branch.

Fixes #53606

Location:
branches/5.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

  • branches/5.8/.github/workflows/test-npm.yml

    r50930 r51357  
    4747  # - Builds WordPress to run from the `build` directory.
    4848  # - Cleans up after building WordPress to the `build` directory.
     49  # - Ensures version-controlled files are not modified or deleted.
    4950  # - Builds WordPress to run from the `src` directory.
    5051  # - Cleans up after building WordPress to the `src` directory.
     52  # - Ensures version-controlled files are not modified or deleted.
    5153  test-npm:
    5254    name: Test NPM on ${{ matrix.os }}
     
    103105        run: npm run grunt clean
    104106
     107      - name: Ensure version-controlled files are not modified or deleted during building and cleaning
     108        run: git diff --exit-code
     109
    105110      - name: Build WordPress in /src
    106111        run: npm run build:dev
     
    108113      - name: Clean after building in /src
    109114        run: npm run grunt clean -- --dev
     115
     116      - name: Ensure version-controlled files are not modified or deleted during building and cleaning
     117        run: git diff --exit-code
    110118
    111119  # Verifies that installing NPM dependencies and building WordPress works as expected on MacOS.
     
    121129  # - Builds WordPress to run from the `build` directory.
    122130  # - Cleans up after building WordPress to the `build` directory.
     131  # - Ensures version-controlled files are not modified or deleted.
    123132  # - Builds WordPress to run from the `src` directory.
    124133  # - Cleans up after building WordPress to the `src` directory.
     134  # - Ensures version-controlled files are not modified or deleted.
    125135  test-npm-macos:
    126136    name: Test NPM on MacOS
     
    160170        run: npm run grunt clean
    161171
     172      - name: Ensure version-controlled files are not modified or deleted during building and cleaning
     173        run: git diff --exit-code
     174
    162175      - name: Build WordPress in /src
    163176        run: npm run build:dev
     
    165178      - name: Clean after building in /src
    166179        run: npm run grunt clean -- --dev
     180
     181      - name: Ensure version-controlled files are not modified or deleted during building and cleaning
     182        run: git diff --exit-code
Note: See TracChangeset for help on using the changeset viewer.