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 @@ -78,6 +78,25 @@ function get_matrix_include(array $branches) {
7878 return $ jobs ;
7979}
8080
81+ function get_windows_matrix_include (array $ branches ) {
82+ $ jobs = [];
83+ foreach ($ branches as $ branch ) {
84+ $ jobs [] = [
85+ 'branch ' => $ branch ,
86+ 'x64 ' => true ,
87+ 'zts ' => true ,
88+ 'opcache ' => true ,
89+ ];
90+ $ jobs [] = [
91+ 'branch ' => $ branch ,
92+ 'x64 ' => false ,
93+ 'zts ' => false ,
94+ 'opcache ' => false ,
95+ ];
96+ }
97+ return $ jobs ;
98+ }
99+
81100$ trigger = $ argv [1 ] ?? 'schedule ' ;
82101$ attempt = (int ) ($ argv [2 ] ?? 1 );
83102$ discard_cache = ($ trigger === 'schedule ' && $ attempt !== 1 ) || $ trigger === 'workflow_dispatch ' ;
@@ -87,6 +106,8 @@ function get_matrix_include(array $branches) {
87106
88107$ branches = get_branches ();
89108$ matrix_include = get_matrix_include ($ branches );
109+ $ windows_matrix_include = get_windows_matrix_include ($ branches );
90110
91111echo '::set-output name=branches:: ' . json_encode ($ branches , JSON_UNESCAPED_SLASHES ) . "\n" ;
92112echo '::set-output name=matrix-include:: ' . json_encode ($ matrix_include , JSON_UNESCAPED_SLASHES ) . "\n" ;
113+ echo '::set-output name=windows-matrix-include:: ' . json_encode ($ windows_matrix_include , JSON_UNESCAPED_SLASHES ) . "\n" ;
Original file line number Diff line number Diff line change 1111 outputs :
1212 branches : ${{ steps.set-matrix.outputs.branches }}
1313 matrix-include : ${{ steps.set-matrix.outputs.matrix-include }}
14+ windows-matrix-include : ${{ steps.set-matrix.outputs.windows-matrix-include }}
1415 steps :
1516 - uses : actions/checkout@v3
1617 with :
@@ -646,17 +647,13 @@ jobs:
646647 with :
647648 token : ${{ secrets.ACTION_MONITORING_SLACK }}
648649 WINDOWS :
650+ needs : GENERATE_MATRIX
651+ if : ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
649652 strategy :
650653 fail-fast : false
651654 matrix :
652- include :
653- - x64 : true
654- zts : true
655- opcache : true
656- - x64 : false
657- zts : false
658- opcache : false
659- name : " WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
655+ include : ${{ fromJson(needs.GENERATE_MATRIX.outputs.windows-matrix-include) }}
656+ name : " ${{ matrix.branch.name }}_WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
660657 runs-on : windows-2019
661658 env :
662659 PHP_BUILD_CACHE_BASE_DIR : C:\build-cache
@@ -674,6 +671,8 @@ jobs:
674671 run : git config --global core.autocrlf false && git config --global core.eol lf
675672 - name : git checkout
676673 uses : actions/checkout@v3
674+ with :
675+ ref : ${{ matrix.branch.ref }}
677676 - name : Setup
678677 uses : ./.github/actions/setup-windows
679678 - name : Build
You can’t perform that action at this time.
0 commit comments