Skip to content

Commit

Permalink
Add workflow doing comparative testing of toolchain branches accross …
Browse files Browse the repository at this point in the history
…multiple targets
  • Loading branch information
Blackhex committed Jan 15, 2025
1 parent 558b254 commit 6821117
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/build-and-test-toolchain.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Build and test main toolchain

on:
pull_request:
workflow_dispatch:
inputs:
binutils_branch:
Expand Down Expand Up @@ -60,6 +59,8 @@ on:
gcc_test_filter:
type: string

run-name: Build and test ${{ inputs.arch }}-${{ inputs.platform }}-${{ inputs.crt }} toolchain

env:
BINUTILS_BRANCH: ${{ inputs.binutils_branch || 'woarm64' }}
GCC_BRANCH: ${{ inputs.gcc_branch || 'woarm64' }}
Expand All @@ -73,6 +74,8 @@ env:
MODULE: ${{ inputs.gcc_module || '' }}
FILTER: ${{ inputs.gcc_test_filter || '' }}

DISTRO: Ubuntu-22.04

TOOLCHAIN_PATH: ~/work/install

CCACHE: 1
Expand All @@ -83,7 +86,7 @@ env:
jobs:
build-and-test-toolchain:
name: Build and test toolchain
runs-on: [Windows, ARM64, WSL]
runs-on: ${{ inputs.arch == 'x86_64' && 'windows-latest' || fromJson('["Windows", "ARM64"]') }}

env:
WSLENV: BINUTILS_BRANCH:GCC_BRANCH:MINGW_BRANCH:ARCH:PLATFORM:CRT:TAG:MODULE:FILTER:CCACHE:RUN_BOOTSTRAP:UPDATE_SOURCES:GITHUB_OUTPUT/p:GITHUB_STEP_SUMMARY/p
Expand All @@ -95,12 +98,23 @@ jobs:
run: |
Write-Output "timestamp=$((Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ"))" >> "$env:GITHUB_OUTPUT"
- name: Install winget
if: inputs.arch == 'x86_64'
uses: Cyberboss/install-winget@v1

- name: Install WSL
if: inputs.arch == 'x86_64'
uses: Ubuntu/WSL/.github/actions/wsl-install@main
with:
distro: ${{ env.DISTRO }}

- name: Install WSL
if: false
if: inputs.arch != 'x86_64'
run: |
wsl --install --enable-wsl1 --no-launch --distribution Ubuntu-22.04
wsl --install --no-launch --distribution ${{ env.DISTRO }}
- name: Clean up previous build
if: inputs.arch != 'x86_64'
run: |
wsl whoami
wsl rm -rf ~/work
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/test-toolschains.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Comparative test of toolchain branches accross multiple targets

on:
pull_request:
workflow_dispatch:
inputs:
binutils_branch_baseline:
description: 'Baseline Binutils branch'
required: false
default: 'upstream'
binutils_branch_changes:
description: 'Changes Binutils branch'
required: false
default: 'upstream'
gcc_branch_baseline:
description: 'Baseline GCC branch'
required: false
default: 'upstream'
gcc_branch_changes:
description: 'Changes GCC branch'
required: false
default: 'upstream'
mingw_branch_baseline:
description: 'Baseline MinGW branch'
required: false
default: 'upstream'
mingw_branch_changes:
description: 'Changes MinGW branch'
required: false
default: 'upstream'
workflow_call:
inputs:
binutils_branch_baseline:
type: string
binutils_branch_changes:
type: string
gcc_branch_baseline:
type: string
gcc_branch_changes:
type: string
mingw_branch_baseline:
type: string
mingw_branch_changes:
type: string

jobs:

build-and-test-toolchains:
name: Build and test toolchains

strategy:
fail-fast: false
matrix:
arch: [aarch64, x86_64]
platform: [w64-mingw32, pc-linux-gnu]
crt: [ucrt, libc]
exclude:
- arch: x86_64
platform: pc-linux-gnu
- platform: w64-mingw32
crt: libc
- platform: pc-linux-gnu
crt: ucrt

uses: ./.github/workflows/test-toolchain.yml
with:
binutils_branch_baseline: ${{ inputs.binutils_branch_baseline }}
binutils_branch_changes: ${{ inputs.binutils_branch_changes }}
gcc_branch_baseline: ${{ inputs.gcc_branch_baseline }}
gcc_branch_changes: ${{ inputs.gcc_branch_changes }}
mingw_branch_baseline: ${{ inputs.mingw_branch_baseline }}
mingw_branch_changes: ${{ inputs.mingw_branch_changes }}
arch: ${{ matrix.arch }}
platform: ${{ matrix.platform }}
crt: ${{ matrix.crt }}

0 comments on commit 6821117

Please sign in to comment.