1818 description : " Architecture to build on"
1919 type : string
2020 default : " x86_64"
21+ cross :
22+ description : " Use MSYS2 -> MINGW cross-compiler"
23+ type : boolean
24+ default : false
2125 needs :
2226 description : " Parent workflow job dependencies"
2327 type : string
2428 dependencies :
2529 description : " Install additional dependencies"
2630 type : string
2731 default : " "
32+ check :
33+ description : " Enable check step after the package is built"
34+ type : boolean
35+ default : false
36+ check_module :
37+ description : " Module to test"
38+ type : string
39+ default : " "
40+ check_filter :
41+ description : " Test filter"
42+ type : string
43+ default : " "
2844
2945defaults :
3046 run :
3147 shell : msys2 {0}
3248
3349env :
3450 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35- CROSS_BUILD : ${{ inputs.runner_arch == 'aarch64' && '1' || '0' }}
51+ CROSS_BUILD : ${{ inputs.cross && '1' || '0' }}
3652 CLEAN_BUILD : 1
53+ NO_CHECK : ${{ inputs.check && '0' || '1' }}
54+ NO_ARCHIVE : ${{ inputs.check && '1' || '0' }}
55+ MODULE : ${{ inputs.check_module }}
56+ FILTER : ${{ inputs.check_filter }}
3757
3858jobs :
3959 build :
4060 name : Build ${{ inputs.package_name }}
4161 runs-on : >-
4262 ${{ fromJson(inputs.runner_arch == 'aarch64'
4363 && '["Windows", "ARM64", "Blackhex"]'
44- || '["windows-latest"]') }}
64+ || (inputs.check && '["Windows", "X64", "GCC"]' || '["windows-latest"]')
65+ ) }}
66+ timeout-minutes : ${{ inputs.check && 720 || 180 }}
4567
4668 steps :
4769 - name : Kill hanging processes
48- if : ${{ inputs.runner_arch == 'aarch64' }}
70+ if : ${{ inputs.runner_arch == 'aarch64' || inputs.check }}
4971 shell : powershell
5072 run : |
5173 tasklist
6284 git config --global core.longpaths true
6385
6486 - name : Fix $PATH
65- if : ${{ inputs.runner_arch == 'aarch64' }}
87+ if : ${{ inputs.runner_arch == 'aarch64' || inputs.check }}
6688 shell : powershell
6789 run : |
6890 Write-Output "GITHUB_PATH: $env:GITHUB_PATH"
@@ -120,8 +142,11 @@ jobs:
120142 mingw-w64-x86_64-jq \
121143 base-devel \
122144 ${{ contains(inputs.packages_repository, 'MINGW')
123- && 'mingw-w64-cross-mingwarm64-gcc mingw-w64-cross-mingwarm64-windows-default-manifest mingw-w64-x86_64-gcc-libs'
124- || '' }} \
145+ && (inputs.cross
146+ && 'mingw-w64-cross-mingwarm64-gcc mingw-w64-cross-mingwarm64-windows-default-manifest mingw-w64-x86_64-gcc-libs'
147+ || 'mingw-w64-aarch64-gcc')
148+ || '' }} \
149+ ${{ inputs.check && 'dejagnu' || ''}} \
125150 ${{ inputs.dependencies }}
126151
127152 - name : Download artifacts
@@ -139,6 +164,11 @@ jobs:
139164 run : |
140165 `cygpath "${{ github.workspace }}"`/.github/scripts/pthread-headers-hack-before.sh
141166
167+ - name : Patch Dejagnu
168+ if : ${{ inputs.check }}
169+ run : |
170+ `cygpath "${{ github.workspace }}"`/.github/scripts/patch-dejagnu.sh
171+
142172 - name : Setup MINGWARM64 environment
143173 if : ${{ inputs.runner_arch == 'aarch64' }}
144174 run : |
@@ -156,7 +186,7 @@ jobs:
156186 key : ${{ inputs.package_name }}-ccache-${{ steps.enable-ccache.outputs.timestamp }}
157187 restore-keys : ${{ inputs.package_name }}-
158188
159- - name : Build ${{ inputs.package_name }}
189+ - name : Build ${{ inputs.check && 'and test' || '' }} ${{ inputs. package_name }}
160190 working-directory : ${{ github.workspace }}/packages/${{ inputs.package_name }}
161191 run : |
162192 `cygpath "${{ github.workspace }}"`/.github/scripts/build-package.sh ${{ inputs.packages_repository }}
@@ -169,12 +199,21 @@ jobs:
169199 key : ${{ inputs.package_name }}-ccache-${{ steps.enable-ccache.outputs.timestamp }}
170200
171201 - name : Upload ${{ inputs.package_name }}
202+ if : ${{ !inputs.check }}
172203 uses : actions/upload-artifact@v4
173204 with :
174205 name : ${{ inputs.package_name }}
175206 retention-days : 7
176207 path : ${{ github.workspace }}/packages/${{ inputs.package_name }}/*.pkg.tar.zst
177208
209+ - name : Upload ${{ inputs.package_name }} test results
210+ if : ${{ inputs.check }}
211+ uses : actions/upload-artifact@v4
212+ with :
213+ name : ${{ inputs.package_name }}-test-results
214+ retention-days : 14
215+ path : ${{ github.workspace }}/packages/${{ inputs.package_name }}/src/test-results
216+
178217 - name : Upload build folder
179218 if : failure()
180219 uses : actions/upload-artifact@v4
0 commit comments