Skip to content

Commit 6cdc7f7

Browse files
committed
Avoid testing the build process on Windows in forks
1 parent 7f9f932 commit 6cdc7f7

1 file changed

Lines changed: 15 additions & 18 deletions

File tree

.github/workflows/test-build-processes.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,28 @@ jobs:
5555
strategy:
5656
fail-fast: false
5757
matrix:
58-
os: [ ubuntu-24.04, windows-2022 ]
5958
directory: [ 'src', 'build' ]
6059
include:
6160
# Only prepare artifacts for Playground once.
62-
- os: ubuntu-24.04
63-
directory: 'build'
61+
- directory: 'build'
6462
save-build: true
6563
prepare-playground: ${{ github.event_name == 'pull_request' && true || '' }}
66-
6764
with:
68-
os: ${{ matrix.os }}
65+
os: 'ubuntu-24.04'
6966
directory: ${{ matrix.directory }}
7067
save-build: ${{ matrix.save-build && matrix.save-build || false }}
7168
prepare-playground: ${{ matrix.prepare-playground && matrix.prepare-playground || false }}
7269

73-
# Tests the WordPress Core build process on MacOS.
70+
# Tests the WordPress Core build process on additional operating systems.
7471
#
75-
# This is separate from the job above in order to use stricter conditions when determining when to run.
76-
# This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate.
72+
# This is separate from the job above in order to use stricter conditions when determining when to test additional
73+
# operating systems. This avoids unintentionally consuming excessive minutes, as Windows-based jobs consume minutes at
74+
# a 2x rate, and MacOS-based jobs at a 10x rate.
7775
#
7876
# The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is
7977
# currently no way to determine the OS being used on a given job.
8078
# See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
81-
test-core-build-process-macos:
79+
test-core-build-process-extended:
8280
name: Core running from ${{ matrix.directory }}
8381
uses: ./.github/workflows/reusable-test-core-build-process.yml
8482
permissions:
@@ -87,7 +85,7 @@ jobs:
8785
strategy:
8886
fail-fast: false
8987
matrix:
90-
os: [ macos-14 ]
88+
os: [ 'macos-14', 'windows-2022' ]
9189
directory: [ 'src', 'build' ]
9290
with:
9391
os: ${{ matrix.os }}
@@ -103,21 +101,20 @@ jobs:
103101
strategy:
104102
fail-fast: false
105103
matrix:
106-
os: [ ubuntu-24.04, windows-2022 ]
107104
directory: [ 'src', 'build' ]
108105
with:
109-
os: ${{ matrix.os }}
110106
directory: ${{ matrix.directory }}
111107

112-
# Tests the Gutenberg plugin build process on MacOS when run within a wordpress-develop checkout.
108+
# Tests the Gutenberg plugin build process on additional operating systems.
113109
#
114-
# This is separate from the job above in order to use stricter conditions when determining when to run.
115-
# This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate.
110+
# This is separate from the job above in order to use stricter conditions when determining when to test additional
111+
# operating systems. This avoids unintentionally consuming excessive minutes, as Windows-based jobs consume minutes at
112+
# a 2x rate, and MacOS-based jobs at a 10x rate.
116113
#
117114
# The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is
118115
# currently no way to determine the OS being used on a given job.
119116
# See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
120-
test-gutenberg-build-process-macos:
117+
test-gutenberg-build-process-extended:
121118
name: Gutenberg running from ${{ matrix.directory }}
122119
uses: ./.github/workflows/reusable-test-gutenberg-build-process.yml
123120
permissions:
@@ -126,7 +123,7 @@ jobs:
126123
strategy:
127124
fail-fast: false
128125
matrix:
129-
os: [ macos-14 ]
126+
os: [ 'macos-14', 'windows-2022' ]
130127
directory: [ 'src', 'build' ]
131128
with:
132129
os: ${{ matrix.os }}
@@ -138,7 +135,7 @@ jobs:
138135
permissions:
139136
actions: read
140137
contents: read
141-
needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos ]
138+
needs: [ test-core-build-process, test-core-build-process-extended, test-gutenberg-build-process, test-gutenberg-build-process-extended ]
142139
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
143140
with:
144141
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}

0 commit comments

Comments
 (0)