Skip to content

Commit

Permalink
Add workflow for mingw-w64-gcc package testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackhex committed Aug 30, 2024
1 parent 3cb0c8b commit 3e39571
Show file tree
Hide file tree
Showing 7 changed files with 282 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .github/scripts/build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ PACKAGE_REPOSITORY=$1
CLEAN_BUILD=${CLEAN_BUILD:-0}
INSTALL_PACKAGE=${INSTALL_PACKAGE:-0}
NO_EXTRACT=${NO_EXTRACT:-0}
NO_CHECK=${NO_CHECK:-1}

ARGUMENTS="--syncdeps \
--rmdeps \
--noconfirm \
--noprogressbar \
--nocheck \
--skippgpcheck \
--force \
$([ "$NO_EXTRACT" = 1 ] && echo "--noextract" || echo "") \
$([ "$NO_CHECK" = 1 ] && echo "--nocheck " || echo "") \
$([ "$CLEAN_BUILD" = 1 ] && echo "--cleanbuild" || echo "") \
$([ "$INSTALL_PACKAGE" = 1 ] && echo "--install" || echo "")"

Expand Down
14 changes: 14 additions & 0 deletions .github/scripts/patch-dejagnu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -e # exit on error
set -x # echo on
set -o pipefail # fail of any command in pipeline is an error

DIR="`dirname ${BASH_SOURCE[0]}`/../.."
DIR=`realpath $DIR`

pushd /
echo "::group::Patch Dejagnu"
patch -p1 -b -i "$DIR/patches/dejagnu/0001-local-exec.patch"
echo "::endgroup::"
popd
65 changes: 65 additions & 0 deletions .github/workflows/build-and-test-mingw-w64-gcc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build and test mingw-w64-gcc

on:
pull_request:
workflow_dispatch:
inputs:
packages_repository:
description: "MSYS2 packages repository to build from"
type: string
default: "Windows-on-ARM-Experiments/MINGW-packages"
packages_branch:
description: "MSYS2 packages branch to build from"
type: string
default: "woarm64"
arch:
description: 'Architecture to build for'
required: false
default: 'x86_64'
tag:
description: 'Tag to use for the artifact'
required: true
gcc_module:
description: 'GCC module to test'
required: false
default: ''
gcc_test_filter:
description: 'GCC test filter'
required: false
default: ''
workflow_call:
inputs:
packages_repository:
type: string
packages_branch:
type: string
arch:
type: string
tag:
type: string
gcc_module:
type: string
gcc_test_filter:
type: string

env:
ARCH: ${{ inputs.arch || 'x86_64' }}

TAG: ${{ inputs.tag || 'test' }}
MODULE: ${{ inputs.gcc_module || '' }}
FILTER: ${{ inputs.gcc_test_filter || '' }}

defaults:
run:
shell: msys2 {0}

jobs:
build-and-test-mingw-w64-gcc:
name: Build and test mingw-w64-gcc
uses: ./.github/workflows/build-package.yml
with:
package_name: mingw-w64-gcc
arch: ${{ inputs.arch || 'x86_64' }}
check: true
packages_repository: ${{ inputs.packages_repository || 'Windows-on-ARM-Experiments/MINGW-packages' }}
packages_branch: ${{ inputs.packages_branch || 'woarm64' }}
42 changes: 34 additions & 8 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ on:
description: "Install additional dependencies"
type: string
default: ""
arch:
description: "Architecture to build for"
type: string
default: "aarch64"
cross:
description: "Enable cross-compilation of the package"
type: boolean
default: false
check:
description: "Enable check step after the package is built"
type: boolean
default: false
packages_repository:
description: "MSYS2 packages repository to build from"
type: string
Expand All @@ -28,6 +40,7 @@ defaults:

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NO_CHECK: ${{ inputs.check && '0' || '1' }}

jobs:
build:
Expand All @@ -42,14 +55,23 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Checkout ${{ inputs.packages_repository }} repository
uses: actions/checkout@v4
with:
repository: ${{ inputs.packages_repository }}
ref: ${{ inputs.packages_branch }}
sparse-checkout: ${{ inputs.package_name }}
path: ${{ github.workspace }}/packages

- name: Install dependencies
run: |
pacman -S --noconfirm \
git \
mingw-w64-x86_64-github-cli \
mingw-w64-x86_64-jq \
base-devel \
${{ contains(inputs.packages_repository, 'MINGW') && 'mingw-w64-cross-gcc mingw-w64-x86_64-ccache' || ' ccache' }} \
ccache \
${{ contains(inputs.packages_repository, 'MINGW') && format('{0}-{1}-{2}', 'mingw-w64', inputs.arch, 'gcc')|| '' }} \
${{ inputs.dependencies }}
- name: Download artifacts
Expand All @@ -67,13 +89,10 @@ jobs:
run: |
`cygpath "${{ github.workspace }}"`/.github/scripts/pthread-headers-hack-before.sh
- name: Checkout ${{ inputs.packages_repository }} repository
uses: actions/checkout@v4
with:
repository: ${{ inputs.packages_repository }}
ref: ${{ inputs.packages_branch }}
sparse-checkout: ${{ inputs.package_name }}
path: ${{ github.workspace }}/packages
- name: Patch Dejagnu
if: ${{ inputs.check }}
run: |
`cygpath "${{ github.workspace }}"`/.github/scripts/patch-dejagnu.sh
- name: Enable Ccache
id: enable-ccache
Expand Down Expand Up @@ -108,6 +127,13 @@ jobs:
retention-days: 1
path: ${{ github.workspace }}/packages/${{ inputs.package_name }}/*.pkg.tar.zst

- name: Upload ${{ inputs.package_name }} test results
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.package_name }}-tests
retention-days: 14
path: ${{ github.workspace }}/packages/${{ inputs.package_name }}/src/test-results

- name: Upload build folder
if: failure()
uses: actions/upload-artifact@v4
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
pull_request:
workflow_dispatch:
inputs:
msys2_packages_branch:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/mingw-cross-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
package_name: mingw-w64-cross-headers
packages_repository: Windows-on-ARM-Experiments/MSYS2-packages
packages_branch: ${{ github.event.inputs.msys2_packages_branch || 'woarm64' }}
packages_branch: ${{ inputs.msys2_packages_branch || 'woarm64' }}

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

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

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

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

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

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

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

0 comments on commit 3e39571

Please sign in to comment.