Skip to content

Commit d3ce5ea

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

File tree

8 files changed

+296
-25
lines changed

8 files changed

+296
-25
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: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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 to build for'
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: ''
26+
gcc_test_filter:
27+
description: 'GCC test filter'
28+
required: false
29+
default: ''
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+
defaults:
46+
run:
47+
shell: msys2 {0}
48+
49+
jobs:
50+
build-and-test-mingw-w64-gcc:
51+
name: Build and test mingw-w64-gcc
52+
uses: ./.github/workflows/build-package.yml
53+
with:
54+
package_name: mingw-w64-gcc
55+
packages_repository: ${{ inputs.packages_repository || 'Windows-on-ARM-Experiments/MINGW-packages' }}
56+
packages_branch: ${{ inputs.packages_branch || 'woarm64' }}
57+
arch: ${{ inputs.arch || 'x86_64' }}
58+
check: true
59+
check_module: ${{ inputs.gcc_module || 'gcc-c' }}
60+
check_filter: ${{ inputs.gcc_test_filter || 'compile.exp=103818.c' }}

.github/workflows/build-package.yml

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,52 @@ 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' }}
3149

3250
jobs:
3351
build:
3452
name: Build ${{ inputs.package_name }}
3553
runs-on: windows-latest
54+
timeout-minutes: 720
3655

3756
steps:
3857
- uses: msys2/setup-msys2@v2
@@ -42,14 +61,24 @@ jobs:
4261
- name: Checkout repository
4362
uses: actions/checkout@v4
4463

64+
- name: Checkout ${{ inputs.packages_repository }} repository
65+
uses: actions/checkout@v4
66+
with:
67+
repository: ${{ inputs.packages_repository }}
68+
ref: ${{ inputs.packages_branch }}
69+
sparse-checkout: ${{ inputs.package_name }}
70+
path: ${{ github.workspace }}/packages
71+
4572
- name: Install dependencies
4673
run: |
4774
pacman -S --noconfirm \
4875
git \
4976
mingw-w64-x86_64-github-cli \
5077
mingw-w64-x86_64-jq \
5178
base-devel \
52-
${{ contains(inputs.packages_repository, 'MINGW') && 'mingw-w64-cross-gcc mingw-w64-x86_64-ccache' || ' ccache' }} \
79+
ccache \
80+
${{ contains(inputs.packages_repository, 'MINGW') && format('{0}-{1}-{2}', 'mingw-w64', inputs.arch, 'gcc')|| '' }} \
81+
${{ inputs.check && 'dejagnu' || '' }} \
5382
${{ inputs.dependencies }}
5483
5584
- name: Download artifacts
@@ -67,13 +96,10 @@ jobs:
6796
run: |
6897
`cygpath "${{ github.workspace }}"`/.github/scripts/pthread-headers-hack-before.sh
6998
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
99+
- name: Patch Dejagnu
100+
if: ${{ inputs.check }}
101+
run: |
102+
`cygpath "${{ github.workspace }}"`/.github/scripts/patch-dejagnu.sh
77103
78104
- name: Enable Ccache
79105
id: enable-ccache
@@ -87,7 +113,7 @@ jobs:
87113
key: main-ccache-${{ steps.enable-ccache.outputs.timestamp }}
88114
restore-keys: main-ccache-
89115

90-
- name: Build ${{ inputs.package_name }}
116+
- name: Build ${{ inputs.check && 'and test' || '' }} ${{ inputs.package_name }}
91117
working-directory: ${{ github.workspace }}/packages/${{ inputs.package_name }}
92118
run: |
93119
ccache -svv || true
@@ -102,12 +128,21 @@ jobs:
102128
key: main-ccache-${{ steps.enable-ccache.outputs.timestamp }}
103129

104130
- name: Upload ${{ inputs.package_name }}
131+
if: ${{ !inputs.check }}
105132
uses: actions/upload-artifact@v4
106133
with:
107134
name: ${{ inputs.package_name }}
108135
retention-days: 1
109136
path: ${{ github.workspace }}/packages/${{ inputs.package_name }}/*.pkg.tar.zst
110137

138+
- name: Upload ${{ inputs.package_name }} test results
139+
if: ${{ inputs.check }}
140+
uses: actions/upload-artifact@v4
141+
with:
142+
name: ${{ inputs.package_name }}-tests
143+
retention-days: 14
144+
path: ${{ github.workspace }}/packages/${{ inputs.package_name }}/src/test-results
145+
111146
- name: Upload build folder
112147
if: failure()
113148
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:

.github/workflows/mingw-cross-toolchain.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
with:
2525
package_name: mingw-w64-cross-headers
2626
packages_repository: Windows-on-ARM-Experiments/MSYS2-packages
27-
packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}
27+
packages_branch: ${{ inputs.msys2_packages_branch || 'woarm64' }}
2828

2929
mingw-w64-cross-binutils:
3030
needs: mingw-w64-cross-headers
@@ -33,7 +33,7 @@ jobs:
3333
package_name: mingw-w64-cross-binutils
3434
needs: ${{ toJson(needs) }}
3535
packages_repository: Windows-on-ARM-Experiments/MSYS2-packages
36-
packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}
36+
packages_branch: ${{ inputs.msys2_packages_branch || 'woarm64' }}
3737

3838
mingw-w64-cross-gcc-stage1:
3939
needs: [mingw-w64-cross-headers, mingw-w64-cross-binutils]
@@ -42,7 +42,7 @@ jobs:
4242
package_name: mingw-w64-cross-gcc-stage1
4343
needs: ${{ toJson(needs) }}
4444
packages_repository: Windows-on-ARM-Experiments/MSYS2-packages
45-
packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}
45+
packages_branch: ${{ inputs.msys2_packages_branch || 'woarm64' }}
4646

4747
mingw-w64-cross-windows-default-manifest:
4848
needs: [mingw-w64-cross-binutils, mingw-w64-cross-gcc-stage1]
@@ -51,7 +51,7 @@ jobs:
5151
package_name: mingw-w64-cross-windows-default-manifest
5252
needs: ${{ toJson(needs) }}
5353
packages_repository: Windows-on-ARM-Experiments/MSYS2-packages
54-
packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}
54+
packages_branch: ${{ inputs.msys2_packages_branch || 'woarm64' }}
5555

5656
mingw-w64-cross-crt:
5757
needs:
@@ -66,7 +66,7 @@ jobs:
6666
needs: ${{ toJson(needs) }}
6767
dependencies: mingw-w64-cross-winpthreads
6868
packages_repository: Windows-on-ARM-Experiments/MSYS2-packages
69-
packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}
69+
packages_branch: ${{ inputs.msys2_packages_branch || 'woarm64' }}
7070

7171
mingw-w64-cross-winpthreads:
7272
needs:
@@ -81,7 +81,7 @@ jobs:
8181
package_name: mingw-w64-cross-winpthreads
8282
needs: ${{ toJson(needs) }}
8383
packages_repository: Windows-on-ARM-Experiments/MSYS2-packages
84-
packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}
84+
packages_branch: ${{ inputs.msys2_packages_branch || 'woarm64' }}
8585

8686
mingw-w64-cross-gcc:
8787
needs:
@@ -98,7 +98,7 @@ jobs:
9898
package_name: mingw-w64-cross-gcc
9999
needs: ${{ toJson(needs) }}
100100
packages_repository: Windows-on-ARM-Experiments/MSYS2-packages
101-
packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}
101+
packages_branch: ${{ inputs.msys2_packages_branch || 'woarm64' }}
102102

103103
mingw-w64-cross-zlib:
104104
needs: [
@@ -115,4 +115,4 @@ jobs:
115115
package_name: mingw-w64-cross-zlib
116116
needs: ${{ toJson(needs) }}
117117
packages_repository: Windows-on-ARM-Experiments/MSYS2-packages
118-
packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}
118+
packages_branch: ${{ inputs.msys2_packages_branch || 'woarm64' }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*.code-workspace
2+
.idea/

0 commit comments

Comments
 (0)