Skip to content

Cross-Building

Cross-Building #23

Workflow file for this run

# .github/workflows/cross.yaml
name: Cross-Building
on:
workflow_dispatch:
push:
branches: [ "test" ]
jobs:
build:
strategy:
fail-fast: false
matrix:
target: [
"aarch64-linux-gnu", "arm-linux-gnueabihf",
"powerpc64le-linux-gnu",
"riscv64-linux-gnu",
"mipsel-linux-gnu", "mips64el-linux-gnuabi64", "mipsisa64r6el-linux-gnuabi64",
"alpha-linux-gnu"
]
compiler:
- { ver: "8", osver: "20.04" }
- { ver: "9", osver: "20.04" }
- { ver: "10", osver: "22.04" }
- { ver: "11", osver: "22.04" }
- { ver: "12", osver: "22.04" }
exclude:
- target: "mipsel-linux-gnu"
compiler: { ver: "8" }
- target: "mipsel-linux-gnu"
compiler: { ver: "11" }
- target: "mipsel-linux-gnu"
compiler: { ver: "12" }
- target: "mips64el-linux-gnuabi64"
compiler: { ver: "8" }
- target: "mips64el-linux-gnuabi64"
compiler: { ver: "11" }
- target: "mips64el-linux-gnuabi64"
compiler: { ver: "12" }
- target: "mipsisa64r6el-linux-gnuabi64"
compiler: { ver: "8" }
- target: "mipsisa64r6el-linux-gnuabi64"
compiler: { ver: "11" }
- target: "mipsisa64r6el-linux-gnuabi64"
compiler: { ver: "12" }
name: Build with ${{matrix.target}}-gcc-${{matrix.compiler.ver}}
runs-on: ubuntu-${{matrix.compiler.osver}}
defaults:
run:
shell: bash
steps:
- name: Machine Information
run: |
lscpu; free -h; df -h .
- name: System Information
run: |
date; uname -a; uptime; cat /etc/os-release; ls -C /boot || :
- name: Context Information
run: |
tty || :; id; printf %s\\n "$SHELL"; printf %s\\n "$PATH"; pwd
- name: Setup
run: |
set -x
sudo apt-get update
sudo apt-get install g++-${{matrix.compiler.ver}}-${{matrix.target}} qemu-user
- name: Build Tools Information
run: |
make --version; ${{matrix.target}}-gcc-${{matrix.compiler.ver}} --version
- name: Checkout
uses: actions/checkout@v4
- name: Run Make (and Check)
run: |
QEMU_LD_PREFIX=/usr/${{matrix.target}} \
make -j3 run \
GCC='${{matrix.target}}-gcc-${{matrix.compiler.ver}}' \
GXX='${{matrix.target}}-g++-${{matrix.compiler.ver}}' \
CFLAGS='-Wno-psabi -O3 -fno-stack-protector -fcf-protection=none' \
MARCH=
- name: Upload Results
uses: actions/upload-artifact@v4
with:
name: build-gcc-${{matrix.compiler.ver}}-${{matrix.target}}
path: build