File tree Expand file tree Collapse file tree 2 files changed +28
-8
lines changed Expand file tree Collapse file tree 2 files changed +28
-8
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,25 @@ function get_matrix_include(array $branches) {
81
81
return $ jobs ;
82
82
}
83
83
84
+ function get_windows_matrix_include (array $ branches ) {
85
+ $ jobs = [];
86
+ foreach ($ branches as $ branch ) {
87
+ $ jobs [] = [
88
+ 'branch ' => $ branch ,
89
+ 'x64 ' => true ,
90
+ 'zts ' => true ,
91
+ 'opcache ' => true ,
92
+ ];
93
+ $ jobs [] = [
94
+ 'branch ' => $ branch ,
95
+ 'x64 ' => false ,
96
+ 'zts ' => false ,
97
+ 'opcache ' => false ,
98
+ ];
99
+ }
100
+ return $ jobs ;
101
+ }
102
+
84
103
$ trigger = $ argv [1 ] ?? 'schedule ' ;
85
104
$ attempt = (int ) ($ argv [2 ] ?? 1 );
86
105
$ discard_cache = ($ trigger === 'schedule ' && $ attempt !== 1 ) || $ trigger === 'workflow_dispatch ' ;
@@ -90,8 +109,10 @@ function get_matrix_include(array $branches) {
90
109
91
110
$ branches = get_branches ();
92
111
$ matrix_include = get_matrix_include ($ branches );
112
+ $ windows_matrix_include = get_windows_matrix_include ($ branches );
93
113
94
114
$ f = fopen (getenv ('GITHUB_OUTPUT ' ), 'a ' );
95
115
fwrite ($ f , 'branches= ' . json_encode ($ branches , JSON_UNESCAPED_SLASHES ) . "\n" );
96
116
fwrite ($ f , 'matrix-include= ' . json_encode ($ matrix_include , JSON_UNESCAPED_SLASHES ) . "\n" );
117
+ fwrite ($ f , 'windows-matrix-include= ' . json_encode ($ windows_matrix_include , JSON_UNESCAPED_SLASHES ) . "\n" );
97
118
fclose ($ f );
Original file line number Diff line number Diff line change 13
13
outputs :
14
14
branches : ${{ steps.set-matrix.outputs.branches }}
15
15
matrix-include : ${{ steps.set-matrix.outputs.matrix-include }}
16
+ windows-matrix-include : ${{ steps.set-matrix.outputs.windows-matrix-include }}
16
17
steps :
17
18
- uses : actions/checkout@v3
18
19
with :
@@ -837,17 +838,13 @@ jobs:
837
838
with :
838
839
token : ${{ secrets.ACTION_MONITORING_SLACK }}
839
840
WINDOWS :
841
+ needs : GENERATE_MATRIX
842
+ if : ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
840
843
strategy :
841
844
fail-fast : false
842
845
matrix :
843
- include :
844
- - x64 : true
845
- zts : true
846
- opcache : true
847
- - x64 : false
848
- zts : false
849
- opcache : false
850
- name : " WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
846
+ include : ${{ fromJson(needs.GENERATE_MATRIX.outputs.windows-matrix-include) }}
847
+ name : " ${{ matrix.branch.name }}_WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
851
848
runs-on : windows-2019
852
849
env :
853
850
PHP_BUILD_CACHE_BASE_DIR : C:\build-cache
@@ -865,6 +862,8 @@ jobs:
865
862
run : git config --global core.autocrlf false && git config --global core.eol lf
866
863
- name : git checkout
867
864
uses : actions/checkout@v3
865
+ with :
866
+ ref : ${{ matrix.branch.ref }}
868
867
- name : Setup
869
868
uses : ./.github/actions/setup-windows
870
869
- name : Build
You can’t perform that action at this time.
0 commit comments