Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scheduled workflow: Support multi-arch #27

Merged
merged 9 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ env:

jobs:
debs:
runs-on: ${{ inputs.ARCH == 'x64' && 'ubuntu-22.04' || inputs.ARCH }}
runs-on: ${{ inputs.ARCH == 'x64' && 'ubuntu-22.04' || (inputs.ARCH == 'arm64' && 'ubuntu-22.04-arm' || inputs.ARCH) }}
timeout-minutes: ${{ inputs.ARCH == 'x64' && 340 || 2880 }}
name: build debs
outputs:
Expand Down Expand Up @@ -188,8 +188,7 @@ jobs:

- name: Delete old ccache
if: always() && steps.restore-ccache.outputs.cache-hit
continue-on-error: true
run: gh cache delete "${{ steps.restore-ccache.outputs.cache-primary-key }}"
run: gh cache delete "${{ steps.restore-ccache.outputs.cache-primary-key }}" || true
env:
GH_TOKEN: ${{ github.token }}
- name: Store ccache
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

build:
needs: unittests
name: "${{ matrix.DEB_DISTRO }}, ${{ matrix.ROS_SOURCES }}\
name: "${{ matrix.DEB_DISTRO }}-${{ matrix.ARCH }}, ${{ matrix.ROS_SOURCES }}\
${{ matrix.VERBOSE && format(', verbose={0}', matrix.VERBOSE) || '' }}\
${{ matrix.BUILD_TIMEOUT && format(', timeout={0}', matrix.BUILD_TIMEOUT) || '' }}\
${{ matrix.CONTINUE_ON_ERROR && ', cont-on-err' || '' }}"
Expand All @@ -57,22 +57,23 @@ jobs:
fail-fast: false
matrix:
DEB_DISTRO: [ bookworm, jammy, noble ]
ARCH: [ x64 ]
BUILD_TIMEOUT: [ 0 ]
include:
# defaults (can be overriden with values from include w/o adding jobs)
- { ROS_SOURCES: 'good', DEBS: false, VERBOSE: false }
- { ROS_SOURCES: good, DEBS: false, VERBOSE: false }
# override/add settings for specific distros
- { DEB_DISTRO: bookworm, DEBS: true, VERBOSE: bloom }
- { DEB_DISTRO: noble, VERBOSE: true }
- { DEB_DISTRO: jammy, BUILD_TIMEOUT: 3, ROS_SOURCES: 'good', DEBS: true, EXPECT_EXIT_CODE: 143 }
- { DEB_DISTRO: jammy, ARCH: arm64, BUILD_TIMEOUT: 3, ROS_SOURCES: good, DEBS: true, EXPECT_EXIT_CODE: 143 }
# add failing jobs
- { DEB_DISTRO: focal, ROS_SOURCES: broken, EXPECT_EXIT_CODE: 2, CONTINUE_ON_ERROR: false, DEBS: true }
- { DEB_DISTRO: focal, ROS_SOURCES: broken, EXPECT_EXIT_CODE: 1, CONTINUE_ON_ERROR: true, COLCON_PKG_SELECTION: '--packages-up-to rostime' }
- { DEB_DISTRO: focal, ARCH: x64, ROS_SOURCES: broken, EXPECT_EXIT_CODE: 2, CONTINUE_ON_ERROR: false, DEBS: true }
- { DEB_DISTRO: focal, ARCH: x64, ROS_SOURCES: broken, EXPECT_EXIT_CODE: 1, CONTINUE_ON_ERROR: true, COLCON_PKG_SELECTION: '--packages-up-to rostime' }

uses: ./.github/workflows/build.yaml
with:
DEB_DISTRO: ${{ matrix.DEB_DISTRO }}
ROS_DISTRO: ${{ matrix.ROS_DISTRO }}
ARCH: ${{ matrix.ARCH }}
ROS_SOURCES: .github/workflows/${{ matrix.ROS_SOURCES }}.repos
INSTALL_TO_CHROOT: ${{ matrix.BUILD_TIMEOUT > 0 }} # slow down for timeout test
VERBOSE: ${{ matrix.VERBOSE && matrix.VERBOSE || false }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ jobs:
fail-fast: false
matrix:
DEB_DISTRO: [jammy, noble]
uses: ubi-agni/ros-builder-action/.github/workflows/build.yaml@main
ARCH: [x64, arm64]
uses: ./.github/workflows/build.yaml
with:
DEB_DISTRO: ${{ matrix.DEB_DISTRO }}
ARCH: ${{ matrix.ARCH }}
ROS_SOURCES: ros-one.repos
INSTALL_GPG_KEYS: |
sudo curl -sSL https://ros.packages.techfak.net/gpg.key -o /etc/apt/keyrings/ros-one-keyring.gpg
Expand Down
2 changes: 1 addition & 1 deletion src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function build_pkg {
if [ -n "$opts" ]; then opts="$EXTRA_SBUILD_OPTS $opts"; fi

SBUILD_OPTS="--verbose --chroot=sbuild --no-clean-source --no-run-lintian --dist=$DEB_DISTRO $opts"
ici_label "${SBUILD_QUIET[@]}" sg sbuild -c "sbuild $SBUILD_OPTS" || return 4
ici_label "${SBUILD_QUIET[@]}" ici_asroot -E -H -u "$USER" bash -lc "sbuild $SBUILD_OPTS" || return 4

"${CCACHE_QUIET[@]}" ici_label ccache -sv || return 1
BUILT_PACKAGES+=("$(deb_pkg_name "$pkg_name"): $version_link")
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ echo apt-cacher-ng apt-cacher-ng/tunnelenable boolean true | ici_asroot debconf-
DEBIAN_FRONTEND=noninteractive ici_timed "Install build packages" ici_cmd "${APT_QUIET[@]}" ici_apt_install \
mmdebstrap sbuild schroot devscripts ccache apt-cacher-ng python3-pip python3-rosdep libxml2-utils libarchive-tools \
python3-colcon-package-information python3-colcon-package-selection python3-colcon-ros python3-colcon-cmake \
python3-stdeb python3-all dh-python
python3-stdeb python3-all dh-python build-essential

# Install patched bloom to handle ROS "one" distro key when resolving python and ROS version
ici_timed "Install bloom" ici_asroot pip install -U git+https://github.com/rhaschke/bloom.git@ros-one
Expand Down
Loading