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) {
8181 return $ jobs ;
8282}
8383
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+
84103$ trigger = $ argv [1 ] ?? 'schedule ' ;
85104$ attempt = (int ) ($ argv [2 ] ?? 1 );
86105$ discard_cache = ($ trigger === 'schedule ' && $ attempt !== 1 ) || $ trigger === 'workflow_dispatch ' ;
@@ -90,8 +109,10 @@ function get_matrix_include(array $branches) {
90109
91110$ branches = get_branches ();
92111$ matrix_include = get_matrix_include ($ branches );
112+ $ windows_matrix_include = get_windows_matrix_include ($ branches );
93113
94114$ f = fopen (getenv ('GITHUB_OUTPUT ' ), 'a ' );
95115fwrite ($ f , 'branches= ' . json_encode ($ branches , JSON_UNESCAPED_SLASHES ) . "\n" );
96116fwrite ($ 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" );
97118fclose ($ f );
Original file line number Diff line number Diff line change 1313 outputs :
1414 branches : ${{ steps.set-matrix.outputs.branches }}
1515 matrix-include : ${{ steps.set-matrix.outputs.matrix-include }}
16+ windows-matrix-include : ${{ steps.set-matrix.outputs.windows-matrix-include }}
1617 steps :
1718 - uses : actions/checkout@v3
1819 with :
@@ -837,17 +838,13 @@ jobs:
837838 with :
838839 token : ${{ secrets.ACTION_MONITORING_SLACK }}
839840 WINDOWS :
841+ needs : GENERATE_MATRIX
842+ if : ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
840843 strategy :
841844 fail-fast : false
842845 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' }}"
851848 runs-on : windows-2019
852849 env :
853850 PHP_BUILD_CACHE_BASE_DIR : C:\build-cache
@@ -865,6 +862,8 @@ jobs:
865862 run : git config --global core.autocrlf false && git config --global core.eol lf
866863 - name : git checkout
867864 uses : actions/checkout@v3
865+ with :
866+ ref : ${{ matrix.branch.ref }}
868867 - name : Setup
869868 uses : ./.github/actions/setup-windows
870869 - name : Build
You can’t perform that action at this time.
0 commit comments