Skip to content

Commit

Permalink
Add support for armv6 (raspberry pi) to CD
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkerj committed Oct 18, 2021
1 parent 76a14d7 commit 037529f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
12 changes: 11 additions & 1 deletion .github/scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ apt-get update

# Setup magic vars for foreign packages
if [ "${ARCH}" != "$(uname -m)" ]; then
if [ "${ARCH}" == "armv6"]; then
BUILD_PKGS="curl libc6-${DEBARCH}-cross libc6-dev-${DEBARCH}-cross pkg-config"
else
BUILD_PKGS="gcc-${ARCH}-linux-${ABI} libc6-${DEBARCH}-cross libc6-dev-${DEBARCH}-cross pkg-config"
fi
CROSS=":${DEBARCH}"
BUILD_PKGS="gcc-${ARCH}-linux-${ABI} libc6-${DEBARCH}-cross libc6-dev-${DEBARCH}-cross pkg-config"
dpkg --add-architecture ${DEBARCH}
else
CROSS=""
Expand All @@ -51,6 +55,12 @@ apt-get install -y \
${BUILDDEP_DEFAULT} \
${BUILDDEP_FULL}

if [ "${ARCH}" == "armv6" ]; then
curl -Lo /tmp/raspi-toolchain.tar.gz https://github.com/Pro/raspi-toolchain/releases/latest/download/raspi-toolchain.tar.gz
tar -zxf /tmp/raspi-toolchain.tar.gz -C /opt
echo "/opt/cross-pi-gcc/bin" >> ${GITHUB_PATH}
fi

# Tell rust to cross-compile
if [ "${ARCH}" != "$(uname -m)" ]; then
mkdir -p ~/.cargo
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,31 @@ jobs:
matrix:
build_target: [linux, macos]
artifact_type: [slim, default, full]
arch: [x86_64, armhf, arm64] # "our" name of the arch. How debian, rust and gcc call them will be set later
arch: [x86_64, armv6, armhf, arm64] # "our" name of the arch. How debian, rust and gcc call them will be set later
# remove unwanted combinations. Arm64 macos is not supported by GH right now
exclude:
- build_target: macos
arch: armv6
- build_target: macos
arch: armhf
- build_target: macos
arch: arm64
- build_target: linux
arch: armv6
artifact_type: default
- build_target: linux
arch: armv6
artifact_type: full
include:
# Setup Arch-specific defaults. Different systems use different names
- arch: x86_64
abi: gnu
binarch: x86_64
debarch: amd64
- arch: armv6
abi: gnueabihf
binarch: arm
debarch: armhf
- arch: armhf
abi: gnueabihf
binarch: arm
Expand Down

0 comments on commit 037529f

Please sign in to comment.