Skip to content

Commit

Permalink
Add additional targets for cross-compilation
Browse files Browse the repository at this point in the history
Skip running tests for now.

Signed-off-by: Björn Svensson <[email protected]>
  • Loading branch information
bjosv committed Oct 10, 2024
1 parent 7c41236 commit 6adf42c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 33 deletions.
36 changes: 35 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Build and test
name: Other targets

on: [push, pull_request]

jobs:
Expand Down Expand Up @@ -77,3 +78,36 @@ jobs:
run: |
gmake
mkdir build && cd build && cmake .. && gmake
build-cross:
name: Cross-compile ${{ matrix.config.target }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
config:
- {target: arm, host: arm-linux-gnueabi, qemu: arm, gccver: 12 }
- {target: armhf, host: arm-linux-gnueabihf, qemu: arm, gccver: 12 }
- {target: aarch64, host: aarch64-linux-gnu, qemu: aarch64, gccver: 12 }
- {target: riscv64, host: riscv64-linux-gnu, qemu: riscv64, gccver: 12 }
- {target: ppc, host: powerpc-linux-gnu, qemu: ppc, gccver: 12 }
- {target: ppc64, host: powerpc64-linux-gnu, qemu: ppc64, gccver: 12 }
- {target: ppc64le, host: powerpc64le-linux-gnu, qemu: ppc64le, gccver: 12 }
- {target: s390x, host: s390x-linux-gnu, qemu: s390x, gccver: 12 }
- {target: mips, host: mips-linux-gnu, qemu: mips, gccver: 10 }
- {target: mips64, host: mips64-linux-gnuabi64, qemu: mips64, gccver: 10 }
- {target: mipsel, host: mipsel-linux-gnu, qemu: mipsel, gccver: 10 }
- {target: mips64el, host: mips64el-linux-gnuabi64, qemu: mips64el, gccver: 10 }
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Prepare
uses: awalsh128/cache-apt-pkgs-action@a6c3917cc929dd0345bfb2d3feaf9101823370ad # v1.4.2
with:
packages: gcc-${{ matrix.config.gccver }}-${{ matrix.config.host }}
version: ${{ matrix.config.target }}-1.0
- name: Build
env:
CC: ${{ matrix.config.host }}-gcc-${{ matrix.config.gccver }}
AR: ${{ matrix.config.host }}-ar
run: |
make
32 changes: 0 additions & 32 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,35 +37,3 @@ jobs:
env:
REDIS_DOCKER: redis:alpine
run: make check

build-arm:
name: Cross-compile and test arm linux with Qemu
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: arm
toolset: arm-linux-gnueabi
emulator: qemu-arm
- name: aarch64
toolset: aarch64-linux-gnu
emulator: qemu-aarch64

steps:
- name: Install qemu
if: matrix.emulator
run: sudo apt-get update && sudo apt-get install -y qemu-user
- name: Install platform toolset
if: matrix.toolset
run: sudo apt-get install -y gcc-${{matrix.toolset}}
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Run make
run: make all
env:
CC: ${{matrix.toolset}}-gcc
AR: ${{matrix.toolset}}-ar
- name: Run unittests
env:
REDIS_DOCKER: redis:alpine
TEST_PREFIX: ${{matrix.emulator}} -L /usr/${{matrix.toolset}}/
run: make check

0 comments on commit 6adf42c

Please sign in to comment.