Skip to content

Commit e07daa6

Browse files
committed
Add workflow for mingw-w64-gcc package testing
1 parent 16d7f58 commit e07daa6

File tree

5 files changed

+304
-13
lines changed

5 files changed

+304
-13
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: 'aarch64'
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 || 'aarch64' }}
54+
cross: false
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: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,56 @@ 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: 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

2945
defaults:
3046
run:
3147
shell: msys2 {0}
3248

3349
env:
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

3858
jobs:
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
@@ -62,7 +84,7 @@ jobs:
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"
@@ -114,14 +136,15 @@ jobs:
114136
115137
- name: Install dependencies
116138
run: >-
117-
pacman -S --noconfirm
118-
git
119-
mingw-w64-x86_64-github-cli
120-
mingw-w64-x86_64-jq
121-
base-devel
122-
${{ contains(inputs.packages_repository, 'MINGW')
139+
pacman -S --noconfirm \
140+
git \
141+
mingw-w64-x86_64-github-cli \
142+
mingw-w64-x86_64-jq \
143+
base-devel \
144+
${{ (contains(inputs.packages_repository, 'MINGW') && inputs.cross)
123145
&& 'mingw-w64-cross-mingwarm64-gcc mingw-w64-cross-mingwarm64-windows-default-manifest mingw-w64-x86_64-gcc-libs'
124-
|| 'mingw-w64-aarch64-gcc' }}
146+
|| 'mingw-w64-aarch64-gcc' }} \
147+
${{ inputs.check && 'dejagnu' || '' }} \
125148
${{ inputs.dependencies }}
126149
127150
- name: Download artifacts
@@ -139,6 +162,11 @@ jobs:
139162
run: |
140163
`cygpath "${{ github.workspace }}"`/.github/scripts/pthread-headers-hack-before.sh
141164
165+
- name: Patch Dejagnu
166+
if: ${{ inputs.check }}
167+
run: |
168+
`cygpath "${{ github.workspace }}"`/.github/scripts/patch-dejagnu.sh
169+
142170
- name: Setup MINGWARM64 environment
143171
if: ${{ inputs.runner_arch == 'aarch64' }}
144172
run: |
@@ -156,7 +184,7 @@ jobs:
156184
key: ${{ inputs.package_name }}-ccache-${{ steps.enable-ccache.outputs.timestamp }}
157185
restore-keys: ${{ inputs.package_name }}-
158186

159-
- name: Build ${{ inputs.package_name }}
187+
- name: Build ${{ inputs.check && 'and test' || '' }} ${{ inputs.package_name }}
160188
working-directory: ${{ github.workspace }}/packages/${{ inputs.package_name }}
161189
run: |
162190
`cygpath "${{ github.workspace }}"`/.github/scripts/build-package.sh ${{ inputs.packages_repository }}
@@ -169,12 +197,21 @@ jobs:
169197
key: ${{ inputs.package_name }}-ccache-${{ steps.enable-ccache.outputs.timestamp }}
170198

171199
- name: Upload ${{ inputs.package_name }}
200+
if: ${{ !inputs.check }}
172201
uses: actions/upload-artifact@v4
173202
with:
174203
name: ${{ inputs.package_name }}
175204
retention-days: 7
176205
path: ${{ github.workspace }}/packages/${{ inputs.package_name }}/*.pkg.tar.zst
177206

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

0 commit comments

Comments
 (0)