Skip to content

Build toolchain variants #221

Build toolchain variants

Build toolchain variants #221

Workflow file for this run

name: Build toolchain variants
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
inputs:
binutils_branch:
description: 'Binutils branch to build'
required: false
default: 'woarm64'
gcc_branch:
description: 'GCC branch to build'
required: false
default: 'woarm64'
mingw_branch:
description: 'Mingw branch to build'
required: false
default: 'woarm64'
openblas_branch:
description: 'OpenBLAS branch to test'
required: false
default: 'develop'
openssl_branch:
description: 'OpenSSL branch to test'
required: false
default: 'fix-tests'
env:
BINUTILS_REPO: Windows-on-ARM-Experiments/binutils-woarm64
BINUTILS_BRANCH: ${{ github.event.inputs.binutils_branch || 'woarm64' }}
BINUTILS_VERSION: binutils-master
GCC_REPO: Windows-on-ARM-Experiments/gcc-woarm64
GCC_BRANCH: ${{ github.event.inputs.gcc_branch || 'woarm64' }}
GCC_VERSION: gcc-master
MINGW_REPO: Windows-on-ARM-Experiments/mingw-woarm64
MINGW_BRANCH: ${{ github.event.inputs.mingw_branch || 'woarm64' }}
MINGW_VERSION: mingw-w64-master
OPENBLAS_REPO: OpenMathLib/OpenBLAS.git
OPENBLAS_BRANCH: ${{ github.event.inputs.openblas_branch || 'develop' }}
OPENBLAS_VERSION: openblas-develop
ZLIB_REPO: madler/zlib
ZLIB_BRANCH: 'develop'
ZLIB_VERSION: zlib-develop
OPENSSL_REPO: Windows-on-ARM-Experiments/openssl
OPENSSL_BRANCH: ${{ github.event.inputs.openssl_branch || 'fix-tests' }}
OPENSSL_VERSION: openssl-master
LIBJPEG_TURBO_REPO: libjpeg-turbo/libjpeg-turbo
LIBJPEG_TURBO_BRANCH: main
LIBJPEG_TURBO_VERSION: libjpeg-turbo-main
TOOLCHAIN_PATH: ${{ github.workspace }}/cross
TOOLCHAIN_NAME: aarch64-w64-mingw32-msvcrt
TOOLCHAIN_PACKAGE_NAME: aarch64-w64-mingw32-msvcrt-toolchain.tar.gz
SOURCE_PATH: ${{ github.workspace }}/code
ARTIFACT_PATH: ${{ github.workspace }}/artifact
jobs:
build-toolchain:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [aarch64, x86_64]
platform: [w64-mingw32, linux-gnu]
crt: [msvcrt, ucrt, libc]
exclude:
- platform: linux-gnu
crt: msvcrt
- platform: linux-gnu
crt: ucrt
- platform: w64-mingw32
crt: libc
env:
TARGET: ${{ matrix.arch }}-${{ matrix.platform }}
CRT: ${{ matrix.crt }}
TOOLCHAIN_NAME: ${{ matrix.arch }}-${{ matrix.platform }}-${{ matrix.crt }}
TOOLCHAIN_PACKAGE_NAME: ${{ matrix.arch }}-${{ matrix.platform }}-${{ matrix.crt }}-toolchain.tar.gz
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: ${{ github.workspace }}
- name: Get workflow SHA
id: workflow-sha
run: |
echo sha=$(git log -1 --pretty=format:"%H" .github/workflows/ .github/scripts) >> "$GITHUB_OUTPUT"
- name: Get binutils SHA
id: binutils-sha
run: |
.github/scripts/get-sha.sh ${{ env.BINUTILS_REPO }} ${{ env.BINUTILS_BRANCH }}
- name: Get GCC SHA
id: gcc-sha
run: |
.github/scripts/get-sha.sh ${{ env.GCC_REPO }} ${{ env.GCC_BRANCH }}
- name: Get MinGW SHA
id: mingw-sha
run: |
.github/scripts/get-sha.sh ${{ env.MINGW_REPO }} ${{ env.MINGW_BRANCH }}
- name: Cache toolchain
id: cache-toolchain
uses: actions/cache@v3
with:
path: ${{ env.ARTIFACT_PATH }}/${{ env.TOOLCHAIN_PACKAGE_NAME }}
key: ${{ env.TOOLCHAIN_NAME }}-${{ steps.workflow-sha.outputs.sha }}-${{ steps.binutils-sha.outputs.sha }}-${{ steps.gcc-sha.outputs.sha }}-${{ steps.mingw-sha.outputs.sha }}
- name: Checkout binutils
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
uses: actions/checkout@v4
with:
repository: ${{ env.BINUTILS_REPO }}
ref: ${{ env.BINUTILS_BRANCH }}
path: ${{ env.SOURCE_PATH }}/${{ env.BINUTILS_VERSION }}
- name: Checkout GCC
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
uses: actions/checkout@v4
with:
repository: ${{ env.GCC_REPO }}
ref: ${{ env.GCC_BRANCH }}
path: ${{ env.SOURCE_PATH }}/${{ env.GCC_VERSION }}
- name: Checkout MinGW
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && matrix.platform != 'linux-gnu' }}
uses: actions/checkout@v4
with:
repository: ${{ env.MINGW_REPO }}
ref: ${{ env.MINGW_BRANCH }}
path: ${{ env.SOURCE_PATH }}/${{ env.MINGW_VERSION }}
- name: Install dependencies
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
run: |
.github/scripts/install-dependencies.sh
- name: Install libraries
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
run: |
.github/scripts/install-libraries.sh
- name: Build binutils
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
run: |
.github/scripts/build-binutils.sh
- name: Install cross headers and libraries
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && matrix.platform == 'linux-gnu' }}
run: |
.github/scripts/install-cross-headers-libs.sh
- name: Build MinGW headers
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && matrix.platform != 'linux-gnu' }}
run: |
.github/scripts/build-mingw-headers.sh
- name: Build GCC
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
run: |
.github/scripts/build-gcc.sh
- name: Build MinGW CRT
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && matrix.platform != 'linux-gnu' }}
run: |
.github/scripts/build-mingw-crt.sh
- name: Build libgcc
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
run: |
.github/scripts/build-libgcc.sh
- name: Build MinGW
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && matrix.platform != 'linux-gnu' }}
run: |
.github/scripts/build-mingw.sh
- name: Build GCC libs
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
run: |
.github/scripts/build-gcc-libs.sh
- name: Pack toolchain
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
run: |
.github/scripts/pack-toolchain.sh
- name: Upload artifact
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.TOOLCHAIN_PACKAGE_NAME }}
path: ${{ env.ARTIFACT_PATH }}/${{ env.TOOLCHAIN_PACKAGE_NAME }}
retention-days: 3
outputs:
binutils-sha: ${{ steps.binutils-sha.outputs.sha }}
gcc-sha: ${{ steps.gcc-sha.outputs.sha }}
mingw-sha: ${{ steps.mingw-sha.outputs.sha }}
build-aarch64-tests:
needs: [build-toolchain]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: ${{ github.workspace }}
- name: Download toolchain
uses: actions/cache/restore@v3
with:
path: ${{ env.ARTIFACT_PATH }}/${{ env.TOOLCHAIN_PACKAGE_NAME }}
key: ${{ env.TOOLCHAIN_NAME }}-${{ needs.build-toolchain.outputs.binutils-sha }}-${{ needs.build-toolchain.outputs.gcc-sha }}-${{ needs.build-toolchain.outputs.mingw-sha }}
fail-on-cache-miss: true
- name: Unpack toolchain
run: |
.github/scripts/unpack-toolchain.sh
- name: Build aarch64-tests
run: |
.github/scripts/build-aarch64-tests.sh
- name: Upload tests artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.TOOLCHAIN_NAME }}-tests
path: tests/build/bin/aarch64-mingw-tests.exe
retention-days: 3
execute-aarch64-tests:
needs: [build-aarch64-tests]
runs-on: [Windows, GCC, ARM64]
steps:
- name: Download ${{ env.TOOLCHAIN_NAME }} tests
uses: actions/download-artifact@v4
with:
name: ${{ env.TOOLCHAIN_NAME }}-tests
path: ${{ env.ARTIFACT_PATH }}
- name: Execute ${{ env.TOOLCHAIN_NAME }} tests
run:
${{ env.ARTIFACT_PATH }}\aarch64-mingw-tests.exe
build-openblas:
needs: [build-toolchain]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: ${{ github.workspace }}
- name: Checkout OpenBLAS
uses: actions/checkout@v4
with:
repository: ${{ env.OPENBLAS_REPO }}
ref: ${{ env.OPENBLAS_BRANCH }}
path: ${{ env.SOURCE_PATH }}/${{ env.OPENBLAS_VERSION }}
- name: Download toolchain
uses: actions/cache/restore@v3
with:
path: ${{ env.ARTIFACT_PATH }}/${{ env.TOOLCHAIN_PACKAGE_NAME }}
key: ${{ env.TOOLCHAIN_NAME }}-${{ needs.build-toolchain.outputs.binutils-sha }}-${{ needs.build-toolchain.outputs.gcc-sha }}-${{ needs.build-toolchain.outputs.mingw-sha }}
fail-on-cache-miss: true
- name: Unpack toolchain
run: |
.github/scripts/unpack-toolchain.sh
- name: Build OpenBLAS
run: |
.github/scripts/build-openblas.sh
- name: Pack OpenBLAS tests
run: |
.github/scripts/pack-openblas-tests.sh
- name: Upload tests artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.TOOLCHAIN_NAME }}-openblas-tests
path: ${{ env.ARTIFACT_PATH }}/${{ env.TOOLCHAIN_NAME }}-openblas-tests.zip
retention-days: 3
execute-openblas-tests:
needs: [build-openblas]
runs-on: [Windows, GCC, ARM64]
env:
OPENBLAS_TESTS_PATH: ${{ github.workspace }}/openblas-tests
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: ${{ github.workspace }}
- name: Download OpenBLAS tests
uses: actions/download-artifact@v4
with:
name: ${{ env.TOOLCHAIN_NAME }}-openblas-tests
path: ${{ env.ARTIFACT_PATH }}
- name: Unpack OpenBLAS tests
run: |
.github/scripts/unpack-openblas-tests.ps1
- name: Execute OpenBLAS tests
run: |
C:\Program` Files\Git\bin\bash.exe .github/scripts/test-openblas.sh
build-zlib:
needs: [build-toolchain]
runs-on: ubuntu-latest
env:
ZLIB_PATH: ${{ github.workspace }}/zlib
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: ${{ github.workspace }}
- name: Checkout zlib
uses: actions/checkout@v4
with:
repository: ${{ env.ZLIB_REPO }}
ref: ${{ env.ZLIB_BRANCH }}
path: ${{ env.SOURCE_PATH }}/${{ env.ZLIB_VERSION }}
- name: Download toolchain
uses: actions/cache/restore@v3
with:
path: ${{ env.ARTIFACT_PATH }}/${{ env.TOOLCHAIN_PACKAGE_NAME }}
key: ${{ env.TOOLCHAIN_NAME }}-${{ needs.build-toolchain.outputs.binutils-sha }}-${{ needs.build-toolchain.outputs.gcc-sha }}-${{ needs.build-toolchain.outputs.mingw-sha }}
fail-on-cache-miss: true
- name: Unpack toolchain
run: |
.github/scripts/unpack-toolchain.sh
- name: Build zlib
run: |
.github/scripts/build-zlib.sh
- name: Pack zlib
run: |
.github/scripts/pack-zlib.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.TOOLCHAIN_NAME }}-zlib
path: ${{ env.ARTIFACT_PATH }}/${{ env.TOOLCHAIN_NAME }}-zlib.zip
retention-days: 3
build-openssl:
needs: [build-toolchain, build-zlib]
runs-on: ubuntu-latest
env:
ZLIB_PATH: ${{ github.workspace }}/zlib
OPENSSL_PATH: ${{ github.workspace }}/openssl
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: ${{ github.workspace }}
- name: Checkout OpenSSL
uses: actions/checkout@v4
with:
repository: ${{ env.OPENSSL_REPO }}
ref: ${{ env.OPENSSL_BRANCH }}
path: ${{ env.SOURCE_PATH }}/${{ env.OPENSSL_VERSION }}
- name: Install OpenSSL dependencies
run: |
.github/scripts/install-openssl-dependencies.sh
- name: Download toolchain
uses: actions/cache/restore@v3
with:
path: ${{ env.ARTIFACT_PATH }}/${{ env.TOOLCHAIN_PACKAGE_NAME }}
key: ${{ env.TOOLCHAIN_NAME }}-${{ needs.build-toolchain.outputs.binutils-sha }}-${{ needs.build-toolchain.outputs.gcc-sha }}-${{ needs.build-toolchain.outputs.mingw-sha }}
fail-on-cache-miss: true
- name: Unpack toolchain
run: |
.github/scripts/unpack-toolchain.sh
- name: Download zlib
uses: actions/download-artifact@v4
with:
name: ${{ env.TOOLCHAIN_NAME }}-zlib
path: ${{ env.ARTIFACT_PATH }}
- name: Unpack zlib
run: |
.github/scripts/unpack-zlib.sh
- name: Build OpenSSL
run: |
.github/scripts/build-openssl.sh
- name: Pack OpenSSL
run: |
.github/scripts/pack-openssl.sh
- name: Pack OpenSSL tests
run: |
.github/scripts/pack-openssl-tests.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.TOOLCHAIN_NAME }}-openssl
path: ${{ env.ARTIFACT_PATH }}/${{ env.TOOLCHAIN_NAME }}-openssl.zip
retention-days: 3
- name: Upload tests artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.TOOLCHAIN_NAME }}-openssl-tests
path: ${{ env.ARTIFACT_PATH }}/${{ env.TOOLCHAIN_NAME }}-openssl-tests.zip
retention-days: 3
execute-openssl-tests:
needs: [build-openssl]
runs-on: [Windows, GCC, ARM64]
env:
ZLIB_PATH: ${{ github.workspace }}/zlib
OPENSSL_TESTS_PATH: ${{ github.workspace }}/openssl-tests
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: ${{ github.workspace }}
- name: Checkout OpenSSL
uses: actions/checkout@v4
with:
repository: ${{ env.OPENSSL_REPO }}
ref: ${{ env.OPENSSL_BRANCH }}
path: ${{ env.SOURCE_PATH }}/${{ env.OPENSSL_VERSION }}
- name: Download OpenSSL tests
uses: actions/download-artifact@v4
with:
name: ${{ env.TOOLCHAIN_NAME }}-openssl-tests
path: ${{ env.ARTIFACT_PATH }}
- name: Unpack OpenSSL tests
run: |
.github/scripts/unpack-openssl-tests.ps1
- name: Download zlib
uses: actions/download-artifact@v4
with:
name: ${{ env.TOOLCHAIN_NAME }}-zlib
path: ${{ env.ARTIFACT_PATH }}
- name: Unpack zlib
run: |
.github/scripts/unpack-zlib.ps1
- name: Execute OpenSSL tests
run: |
.github/scripts/execute-openssl-tests.ps1
build-libjpeg-turbo:
needs: [build-toolchain]
runs-on: ubuntu-latest
env:
LIBJPEG_TURBO_PATH: ${{ github.workspace }}/libjpeg-turbo
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: ${{ github.workspace }}
- name: Checkout libjpeg-turbo
uses: actions/checkout@v4
with:
repository: ${{ env.LIBJPEG_TURBO_REPO }}
ref: ${{ env.LIBJPEG_TURBO_BRANCH }}
path: ${{ env.SOURCE_PATH }}/${{ env.LIBJPEG_TURBO_VERSION }}
- name: Patch libjpeg-turbo
run: |
.github/scripts/patch-libjpeg-turbo.sh
- name: Download toolchain
uses: actions/cache/restore@v3
with:
path: ${{ env.ARTIFACT_PATH }}/${{ env.TOOLCHAIN_PACKAGE_NAME }}
key: ${{ env.TOOLCHAIN_NAME }}-${{ needs.build-toolchain.outputs.binutils-sha }}-${{ needs.build-toolchain.outputs.gcc-sha }}-${{ needs.build-toolchain.outputs.mingw-sha }}
fail-on-cache-miss: true
- name: Unpack toolchain
run: |
.github/scripts/unpack-toolchain.sh
- name: Build libjpeg-turbo
run: |
.github/scripts/build-libjpeg-turbo.sh
- name: Pack libjpeg-turbo
run: |
.github/scripts/pack-libjpeg-turbo.sh
- name: Pack libjpeg-turbo tests
run: |
.github/scripts/pack-libjpeg-turbo-tests.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.TOOLCHAIN_NAME }}-libjpeg-turbo
path: ${{ env.ARTIFACT_PATH }}/${{ env.TOOLCHAIN_NAME }}-libjpeg-turbo.zip
retention-days: 3
- name: Upload tests artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.TOOLCHAIN_NAME }}-libjpeg-turbo-tests
path: ${{ env.ARTIFACT_PATH }}/${{ env.TOOLCHAIN_NAME }}-libjpeg-turbo-tests.zip
retention-days: 3
execute-libpeg-turbo-tests:
needs: [build-libjpeg-turbo]
runs-on: [Windows, GCC, ARM64]
env:
LIBJPEG_TURBO_TESTS_PATH: ${{ github.workspace }}/libjpeg-turbo-tests
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: ${{ github.workspace }}
- name: Download libjpeg-turbo tests
uses: actions/download-artifact@v4
with:
name: ${{ env.TOOLCHAIN_NAME }}-libjpeg-turbo-tests
path: ${{ env.ARTIFACT_PATH }}
- name: Unpack libjpeg-turbo tests
run: |
.github/scripts/unpack-libjpeg-turbo-tests.ps1
- name: Execute libjpeg-turbo tests
run: |
.github/scripts/execute-libjpeg-turbo-tests.ps1