Skip to content

Commit

Permalink
Allow selection of CPU architecture for build
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed Oct 16, 2024
1 parent 6080f0d commit f45369f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ on:
required: false # defaults to 'one'
DEB_DISTRO:
type: string
description: The Debian/Ubuntu distribution codename to compile for.
description: The Debian/Ubuntu distribution codename to compile for
required: false # defaults to 'lsb_release -cs'
ARCH:
type: string
required: false
description: CPU architecture
default: x64
ROS_SOURCES:
type: string
description: ROS sources to compile. See README.md for details.
Expand Down Expand Up @@ -118,7 +123,7 @@ env:

jobs:
debs:
runs-on: ubuntu-22.04
runs-on: ${{ inputs.ARCH == 'x64' && 'ubuntu-22.04' || inputs.ARCH }}
name: build debs
outputs:
LATEST_PACKAGE: ${{ steps.build.outputs.LATEST_PACKAGE }}
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/interactive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ on:
required: true
description: 'ROS distribution codename:'
default: one
ARCH:
type: choice
required: true
description: 'Architecture:'
default: x64
options:
- x64
- arm64

# source selection
ROS_SOURCES:
Expand Down Expand Up @@ -60,6 +68,7 @@ jobs:
with:
DEB_DISTRO: ${{ inputs.DEB_DISTRO || vars.DEB_DISTRO }}
ROS_DISTRO: ${{ inputs.ROS_DISTRO || vars.ROS_DISTRO || 'one' }}
ARCH: ${{ inputs.ARCH || vars.ARCH || 'x64' }}
ROS_SOURCES: ${{ inputs.ROS_SOURCES || vars.ROS_SOURCES }}
INSTALL_GPG_KEYS: |
sudo curl -sSL https://ros.packages.techfak.net/gpg.key -o /etc/apt/keyrings/ros-one-keyring.gpg
Expand Down
13 changes: 12 additions & 1 deletion src/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,18 @@ if debian-distro-info --all | grep -q "$DEB_DISTRO"; then

elif ubuntu-distro-info --all | grep -q "$DEB_DISTRO"; then
export DISTRIBUTION=ubuntu
export DISTRIBUTION_REPO=http://azure.archive.ubuntu.com/ubuntu
case "$(dpkg --print-architecture)" in
amd64)
export DISTRIBUTION_REPO=http://archive.ubuntu.com/ubuntu
;;
arm64,armhf)
export DISTRIBUTION_REPO=http://ports.ubuntu.com/ubuntu-ports
;;
*)
gha_error "Unknown architecture: $ARCH"
ici_exit 1
;;
esac
else
gha_error "Unknown DEB_DISTRO: $DEB_DISTRO"
ici_exit 1
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ ici_timed "Install bloom" ici_asroot pip install -U git+https://github.com/rhasc
# Install patched vcstool to allow for treeless clones
ici_timed "Install vcstool" ici_asroot pip install -U git+https://github.com/rhaschke/vcstool.git@master

# remove existing rosdep config to avoid conflicts with rosdep init
ici_asroot rm -f /etc/ros/rosdep/sources.list.d/20-default.list
ici_timed "rosdep init" ici_asroot rosdep init

# Start apt-cacher-ng if not yet running (for example in docker)
Expand Down

0 comments on commit f45369f

Please sign in to comment.