@@ -49,6 +49,52 @@ concurrency:
4949permissions : {}
5050
5151jobs :
52+ # Checks for zero-byte files.
53+ #
54+ # Occasionally, binary files such as images and fonts are added to themes incorrectly.
55+ # This checks that all files contain contents.
56+ #
57+ # Performs the following steps:
58+ # - Checks out the repository.
59+ # - Checks for zero-byte (empty) files.
60+ check-for-empty-files :
61+ name : ${{ matrix.theme }} empty file check
62+ runs-on : ubuntu-latest
63+ permissions :
64+ contents : read
65+ timeout-minutes : 10
66+ if : ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
67+ strategy :
68+ fail-fast : false
69+ matrix :
70+ theme : [
71+ ' twentytwentyfour' ,
72+ ' twentytwentythree' ,
73+ ' twentytwentytwo' ,
74+ ' twentytwentyone' ,
75+ ' twentytwenty' ,
76+ ' twentynineteen' ,
77+ ' twentyseventeen' ,
78+ ' twentysixteen' ,
79+ ' twentyfifteen' ,
80+ ' twentyfourteen' ,
81+ ' twentythirteen' ,
82+ ' twentytwelve' ,
83+ ' twentyeleven' ,
84+ ' twentyten'
85+ ]
86+
87+ steps :
88+ - name : Checkout repository
89+ uses : actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
90+ with :
91+ ref : ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref }}
92+ show-progress : ${{ runner.debug == '1' && 'true' || 'false' }}
93+
94+ - name : Check for zero-byte (empty) files
95+ run : |
96+ [[ ! $(find src/wp-content/themes/${{ matrix.theme }} -empty) ]]
97+
5298 # Tests the build script for themes that have one.
5399 #
54100 # Performs the following steps:
@@ -110,13 +156,14 @@ jobs:
110156 runs-on : ubuntu-latest
111157 permissions :
112158 contents : read
113- needs : [ test-build-scripts ]
159+ needs : [ check-for-empty-files, test-build-scripts ]
114160 timeout-minutes : 10
115161 if : ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
116162 strategy :
117163 fail-fast : false
118164 matrix :
119165 theme : [
166+ ' twentytwentyfour' ,
120167 ' twentytwentythree' ,
121168 ' twentytwentytwo' ,
122169 ' twentytwentyone' ,
@@ -152,7 +199,7 @@ jobs:
152199 permissions :
153200 actions : read
154201 contents : read
155- needs : [ bundle-theme, test-build-scripts ]
202+ needs : [ check-for-empty-files, bundle-theme, test-build-scripts ]
156203 if : ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
157204 with :
158205 calling_status : ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
0 commit comments