Skip to content

Commit ccbe63c

Browse files
committed
Add workflow for mingw-w64-gcc package testing
1 parent 3cb0c8b commit ccbe63c

File tree

5 files changed

+306
-16
lines changed

5 files changed

+306
-16
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: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Build and test mingw-w64-gcc
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
packages_repository:
7+
description: "MSYS2 packages repository to build from"
8+
type: string
9+
default: "Windows-on-ARM-Experiments/MINGW-packages"
10+
packages_branch:
11+
description: "MSYS2 packages branch to build from"
12+
type: string
13+
default: "woarm64"
14+
arch:
15+
description: 'Architecture to build for'
16+
required: false
17+
default: 'x86_64'
18+
tag:
19+
description: 'Tag to use for the artifact'
20+
required: true
21+
gcc_module:
22+
description: 'GCC module to test'
23+
required: false
24+
default: ''
25+
gcc_test_filter:
26+
description: 'GCC test filter'
27+
required: false
28+
default: ''
29+
workflow_call:
30+
inputs:
31+
packages_repository:
32+
type: string
33+
packages_branch:
34+
type: string
35+
arch:
36+
type: string
37+
tag:
38+
type: string
39+
gcc_module:
40+
type: string
41+
gcc_test_filter:
42+
type: string
43+
44+
jobs:
45+
build-and-test-mingw-w64-gcc:
46+
name: Build and test mingw-w64-gcc
47+
uses: ./.github/workflows/build-package.yml
48+
with:
49+
package_name: mingw-w64-gcc
50+
packages_repository: ${{ inputs.packages_repository || 'Windows-on-ARM-Experiments/MINGW-packages' }}
51+
packages_branch: ${{ inputs.packages_branch || 'woarm64' }}
52+
arch: ${{ inputs.arch || 'x86_64' }}
53+
check: true
54+
check_module: ${{ inputs.gcc_module || 'gcc-c' }}
55+
check_filter: ${{ inputs.gcc_test_filter || 'compile.exp=103818.c' }}
56+
57+
create-summary:
58+
needs: build-and-test-mingw-w64-gcc
59+
name: Create summary
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- name: Checkout mingw-woarm64-build repository
64+
uses: actions/checkout@v4
65+
with:
66+
repository: Windows-on-ARM-Experiments/mingw-woarm64-build
67+
ref: fix-create-summary
68+
69+
- name: Download test results artifacts
70+
uses: actions/download-artifact@v4
71+
with:
72+
name: mingw-w64-gcc-test-results
73+
path: ${{ github.workspace }}/test-results
74+
75+
- name: Create summary
76+
run: |
77+
.github/scripts/toolchain/create-gcc-summary.sh ${{ github.workspace }}/test-results >> $GITHUB_STEP_SUMMARY

.github/workflows/build-package.yml

Lines changed: 52 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,54 @@ on:
66
package_name:
77
description: "Package name to build"
88
type: string
9+
packages_repository:
10+
description: "MSYS2 packages repository to build from"
11+
type: string
12+
default: "Windows-on-ARM-Experiments/MSYS2-packages"
13+
packages_branch:
14+
description: "MSYS2 packages branch to build from"
15+
type: string
16+
default: "woarm64"
17+
arch:
18+
description: "Architecture to build for"
19+
type: string
20+
default: "aarch64"
921
needs:
1022
description: "Parent workflow job dependencies"
1123
type: string
1224
dependencies:
1325
description: "Install additional dependencies"
1426
type: string
1527
default: ""
16-
packages_repository:
17-
description: "MSYS2 packages repository to build from"
28+
check:
29+
description: "Enable check step after the package is built"
30+
type: boolean
31+
default: false
32+
check_module:
33+
description: "Module to test"
1834
type: string
19-
default: "Windows-on-ARM-Experiments/MSYS2-packages"
20-
packages_branch:
21-
description: "MSYS2 packages branch to build from"
35+
default: ""
36+
check_filter:
37+
description: "Test filter"
2238
type: string
23-
default: "woarm64"
39+
default: ""
2440

2541
defaults:
2642
run:
2743
shell: msys2 {0}
2844

2945
env:
3046
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
NO_CHECK: ${{ inputs.check && '0' || '1' }}
48+
NO_ARCHIVE: ${{ inputs.check && '1' || '0' }}
49+
MODULE: ${{ inputs.check_module }}
50+
FILTER: ${{ inputs.check_filter }}
3151

3252
jobs:
3353
build:
3454
name: Build ${{ inputs.package_name }}
3555
runs-on: windows-latest
56+
timeout-minutes: 720
3657

3758
steps:
3859
- uses: msys2/setup-msys2@v2
@@ -42,14 +63,24 @@ jobs:
4263
- name: Checkout repository
4364
uses: actions/checkout@v4
4465

66+
- name: Checkout ${{ inputs.packages_repository }} repository
67+
uses: actions/checkout@v4
68+
with:
69+
repository: ${{ inputs.packages_repository }}
70+
ref: ${{ inputs.packages_branch }}
71+
sparse-checkout: ${{ inputs.package_name }}
72+
path: ${{ github.workspace }}/packages
73+
4574
- name: Install dependencies
4675
run: |
4776
pacman -S --noconfirm \
4877
git \
4978
mingw-w64-x86_64-github-cli \
5079
mingw-w64-x86_64-jq \
5180
base-devel \
52-
${{ contains(inputs.packages_repository, 'MINGW') && 'mingw-w64-cross-gcc mingw-w64-x86_64-ccache' || ' ccache' }} \
81+
ccache \
82+
${{ contains(inputs.packages_repository, 'MINGW') && format('{0}-{1}-{2}', 'mingw-w64', inputs.arch, 'gcc')|| '' }} \
83+
${{ inputs.check && 'dejagnu' || '' }} \
5384
${{ inputs.dependencies }}
5485
5586
- name: Download artifacts
@@ -67,13 +98,10 @@ jobs:
6798
run: |
6899
`cygpath "${{ github.workspace }}"`/.github/scripts/pthread-headers-hack-before.sh
69100
70-
- name: Checkout ${{ inputs.packages_repository }} repository
71-
uses: actions/checkout@v4
72-
with:
73-
repository: ${{ inputs.packages_repository }}
74-
ref: ${{ inputs.packages_branch }}
75-
sparse-checkout: ${{ inputs.package_name }}
76-
path: ${{ github.workspace }}/packages
101+
- name: Patch Dejagnu
102+
if: ${{ inputs.check }}
103+
run: |
104+
`cygpath "${{ github.workspace }}"`/.github/scripts/patch-dejagnu.sh
77105
78106
- name: Enable Ccache
79107
id: enable-ccache
@@ -87,7 +115,7 @@ jobs:
87115
key: main-ccache-${{ steps.enable-ccache.outputs.timestamp }}
88116
restore-keys: main-ccache-
89117

90-
- name: Build ${{ inputs.package_name }}
118+
- name: Build ${{ inputs.check && 'and test' || '' }} ${{ inputs.package_name }}
91119
working-directory: ${{ github.workspace }}/packages/${{ inputs.package_name }}
92120
run: |
93121
ccache -svv || true
@@ -102,12 +130,21 @@ jobs:
102130
key: main-ccache-${{ steps.enable-ccache.outputs.timestamp }}
103131

104132
- name: Upload ${{ inputs.package_name }}
133+
if: ${{ !inputs.check }}
105134
uses: actions/upload-artifact@v4
106135
with:
107136
name: ${{ inputs.package_name }}
108137
retention-days: 1
109138
path: ${{ github.workspace }}/packages/${{ inputs.package_name }}/*.pkg.tar.zst
110139

140+
- name: Upload ${{ inputs.package_name }} test results
141+
if: ${{ inputs.check }}
142+
uses: actions/upload-artifact@v4
143+
with:
144+
name: ${{ inputs.package_name }}-test-results
145+
retention-days: 14
146+
path: ${{ github.workspace }}/packages/${{ inputs.package_name }}/src/test-results
147+
111148
- name: Upload build folder
112149
if: failure()
113150
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)