Skip to content

Commit d974c3f

Browse files
committed
Add workflow for mingw-w64-gcc package testing
1 parent 8dd683b commit d974c3f

File tree

7 files changed

+346
-7
lines changed

7 files changed

+346
-7
lines changed

.github/scripts/build-package.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,18 @@ PACKAGE_REPOSITORY=$1
99
CLEAN_BUILD=${CLEAN_BUILD:-0}
1010
INSTALL_PACKAGE=${INSTALL_PACKAGE:-0}
1111
NO_EXTRACT=${NO_EXTRACT:-0}
12+
NO_CHECK=${NO_CHECK:-1}
13+
NO_ARCHIVE=${NO_ARCHIVE:-0}
1214

1315
ARGUMENTS="--syncdeps \
1416
--rmdeps \
1517
--noconfirm \
1618
--noprogressbar \
17-
--nocheck \
1819
--skippgpcheck \
1920
--force \
2021
$([ "$NO_EXTRACT" = 1 ] && echo "--noextract" || echo "") \
22+
$([ "$NO_CHECK" = 1 ] && echo "--nocheck " || echo "") \
23+
$([ "$NO_ARCHIVE" = 1 ] && echo "--noarchive" || echo "") \
2124
$([ "$CLEAN_BUILD" = 1 ] && echo "--cleanbuild" || echo "") \
2225
$([ "$INSTALL_PACKAGE" = 1 ] && echo "--install" || echo "")"
2326

.github/scripts/patch-dejagnu.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -e # exit on error
4+
set -x # echo on
5+
set -o pipefail # fail of any command in pipeline is an error
6+
7+
DIR="`dirname ${BASH_SOURCE[0]}`/../.."
8+
DIR=`realpath $DIR`
9+
10+
pushd /
11+
echo "::group::Patch Dejagnu"
12+
patch -p1 -b -i "$DIR/patches/dejagnu/0001-local-exec.patch"
13+
echo "::endgroup::"
14+
popd
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Build and test mingw-w64-gcc
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
inputs:
7+
packages_repository:
8+
description: "MSYS2 packages repository to build from"
9+
type: string
10+
default: "Windows-on-ARM-Experiments/MINGW-packages"
11+
packages_branch:
12+
description: "MSYS2 packages branch to build from"
13+
type: string
14+
default: "woarm64"
15+
arch:
16+
description: 'Architecture that should be built and tested'
17+
required: false
18+
default: 'x86_64'
19+
tag:
20+
description: 'Tag to use for the artifact'
21+
required: true
22+
gcc_module:
23+
description: 'GCC module to test'
24+
required: false
25+
default: 'gcc-c'
26+
gcc_test_filter:
27+
description: 'GCC test filter'
28+
required: false
29+
default: 'compile.exp=103818.c'
30+
workflow_call:
31+
inputs:
32+
packages_repository:
33+
type: string
34+
packages_branch:
35+
type: string
36+
arch:
37+
type: string
38+
tag:
39+
type: string
40+
gcc_module:
41+
type: string
42+
gcc_test_filter:
43+
type: string
44+
45+
jobs:
46+
build-and-test-mingw-w64-gcc:
47+
name: Build and test mingw-w64-gcc
48+
uses: ./.github/workflows/build-package.yml
49+
with:
50+
package_name: mingw-w64-gcc
51+
packages_repository: ${{ inputs.packages_repository || 'Windows-on-ARM-Experiments/MINGW-packages' }}
52+
packages_branch: ${{ inputs.packages_branch || 'woarm64' }}
53+
runner_arch: ${{ inputs.arch || 'x86_64' }}
54+
cross: true
55+
check: true
56+
check_module: ${{ inputs.gcc_module || '' }}
57+
check_filter: ${{ inputs.gcc_test_filter || '' }}
58+
59+
create-summary:
60+
needs: build-and-test-mingw-w64-gcc
61+
name: Create summary
62+
runs-on: ubuntu-latest
63+
64+
steps:
65+
- name: Checkout mingw-woarm64-build repository
66+
uses: actions/checkout@v4
67+
with:
68+
repository: Windows-on-ARM-Experiments/mingw-woarm64-build
69+
70+
- name: Download test results artifacts
71+
uses: actions/download-artifact@v4
72+
with:
73+
name: mingw-w64-gcc-test-results
74+
path: ${{ github.workspace }}/test-results
75+
76+
- name: Create summary
77+
run: |
78+
.github/scripts/toolchain/create-gcc-summary.sh ${{ github.workspace }}/test-results >> $GITHUB_STEP_SUMMARY

.github/workflows/build-package.yml

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,29 @@ on:
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: true
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

2945
defaults:
3046
run:
@@ -33,18 +49,24 @@ defaults:
3349
env:
3450
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3551
CLEAN_BUILD: 1
52+
NO_CHECK: ${{ inputs.check && '0' || '1' }}
53+
NO_ARCHIVE: ${{ inputs.check && '1' || '0' }}
54+
MODULE: ${{ inputs.check_module }}
55+
FILTER: ${{ inputs.check_filter }}
3656

3757
jobs:
3858
build:
3959
name: Build ${{ inputs.package_name }}
4060
runs-on: >-
4161
${{ fromJson(inputs.runner_arch == 'aarch64'
4262
&& '["Windows", "ARM64", "Blackhex"]'
43-
|| '["windows-latest"]') }}
63+
|| (inputs.check && '["Windows", "X64", "GCC"]' || '["windows-latest"]')
64+
) }}
65+
timeout-minutes: ${{ inputs.check && 720 || 180 }}
4466

4567
steps:
4668
- name: Kill hanging processes
47-
if: ${{ inputs.runner_arch == 'aarch64' }}
69+
if: ${{ inputs.runner_arch == 'aarch64' || inputs.check }}
4870
shell: powershell
4971
run: |
5072
tasklist
@@ -61,7 +83,7 @@ jobs:
6183
git config --global core.longpaths true
6284
6385
- name: Fix $PATH
64-
if: ${{ inputs.runner_arch == 'aarch64' }}
86+
if: ${{ inputs.runner_arch == 'aarch64' || inputs.check }}
6587
shell: powershell
6688
run: |
6789
Write-Output "GITHUB_PATH: $env:GITHUB_PATH"
@@ -118,7 +140,10 @@ jobs:
118140
mingw-w64-x86_64-github-cli \
119141
mingw-w64-x86_64-jq \
120142
base-devel \
121-
${{ contains(inputs.packages_repository, 'MINGW') && 'mingw-w64-cross-mingwarm64-gcc mingw-w64-cross-mingwarm64-windows-default-manifest mingw-w64-x86_64-gcc-libs' || '' }} \
143+
${{ (contains(inputs.packages_repository, 'MINGW') && inputs.cross)
144+
&& 'mingw-w64-cross-mingwarm64-gcc mingw-w64-cross-mingwarm64-windows-default-manifest mingw-w64-x86_64-gcc-libs'
145+
|| '' }} \
146+
${{ inputs.check && 'dejagnu' || '' }} \
122147
${{ inputs.dependencies }}
123148
124149
- name: Download artifacts
@@ -136,6 +161,11 @@ jobs:
136161
run: |
137162
`cygpath "${{ github.workspace }}"`/.github/scripts/pthread-headers-hack-before.sh
138163
164+
- name: Patch Dejagnu
165+
if: ${{ inputs.check }}
166+
run: |
167+
`cygpath "${{ github.workspace }}"`/.github/scripts/patch-dejagnu.sh
168+
139169
- name: Setup MINGWARM64 environment
140170
if: ${{ inputs.runner_arch == 'aarch64' }}
141171
run: |
@@ -153,7 +183,7 @@ jobs:
153183
key: ${{ inputs.package_name }}-ccache-${{ steps.enable-ccache.outputs.timestamp }}
154184
restore-keys: ${{ inputs.package_name }}-
155185

156-
- name: Build ${{ inputs.package_name }}
186+
- name: Build ${{ inputs.check && 'and test' || '' }} ${{ inputs.package_name }}
157187
working-directory: ${{ github.workspace }}/packages/${{ inputs.package_name }}
158188
run: |
159189
`cygpath "${{ github.workspace }}"`/.github/scripts/build-package.sh ${{ inputs.packages_repository }}
@@ -166,12 +196,21 @@ jobs:
166196
key: ${{ inputs.package_name }}-ccache-${{ steps.enable-ccache.outputs.timestamp }}
167197

168198
- name: Upload ${{ inputs.package_name }}
199+
if: ${{ !inputs.check }}
169200
uses: actions/upload-artifact@v4
170201
with:
171202
name: ${{ inputs.package_name }}
172203
retention-days: 1
173204
path: ${{ github.workspace }}/packages/${{ inputs.package_name }}/*.pkg.tar.zst
174205

206+
- name: Upload ${{ inputs.package_name }} test results
207+
if: ${{ inputs.check }}
208+
uses: actions/upload-artifact@v4
209+
with:
210+
name: ${{ inputs.package_name }}-test-results
211+
retention-days: 14
212+
path: ${{ github.workspace }}/packages/${{ inputs.package_name }}/src/test-results
213+
175214
- name: Upload build folder
176215
if: failure()
177216
uses: actions/upload-artifact@v4

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
pull_request:
87
workflow_dispatch:
98
inputs:
109
msys2_packages_branch:

0 commit comments

Comments
 (0)