Skip to content

Commit

Permalink
scheduled: Support multi-arch
Browse files Browse the repository at this point in the history
  • Loading branch information
furushchev committed Feb 10, 2025
1 parent b816d28 commit fefa510
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .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
32 changes: 3 additions & 29 deletions .github/workflows/scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,8 @@ 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/scheduled_job.yaml
with:
DEB_DISTRO: ${{ matrix.DEB_DISTRO }}
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
sudo mkdir -p /etc/ros/rosdep/sources.list.d
echo "yaml https://ros.packages.techfak.net/ros-one.yaml ${{ matrix.DEB_DISTRO }}" | sudo tee /etc/ros/rosdep/sources.list.d/1-ros-one.list
EXTRA_DEB_SOURCES: "deb [signed-by=/etc/apt/keyrings/ros-one-keyring.gpg] https://ros.packages.techfak.net ${{matrix.DEB_DISTRO}}-testing main"
# proceed from existing debs artifact if run_attempt > 1
DOWNLOAD_DEBS: ${{ github.run_attempt != '1' }}
DEBS_ARTIFACT_NAME: ${{ matrix.DEB_DISTRO }}-debs
SKIP_EXISTING: true
SKIP_KNOWN_FAILING: true
CONTINUE_ON_ERROR: true
INSTALL_TO_CHROOT: false

deploy:
needs: build
if: always() && vars.DEPLOY_URL
timeout-minutes: 15
runs-on: ubuntu-latest
concurrency:
# Ensure exclusive access to deployment target
group: ${{ vars.DEPLOY_URL }}
cancel-in-progress: false
steps:
- name: Import build artifacts to reprepro server
uses: ubi-agni/ros-builder-action/reprepro@main
with:
url: "${{ vars.DEPLOY_URL }}?run_id=${{ github.run_id }}&arch=x64"
ARCH: ${{ matrix.ARCH }}
50 changes: 50 additions & 0 deletions .github/workflows/scheduled_job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: scheduled job
run-name: "scheduled: ${{ inputs.DEB_DISTRO }}-${{ inputs.ARCH }}"

on:
# make this workflow reusable (and only so)
workflow_call:
inputs:
DEB_DISTRO:
type: string
description: The Debian/Ubuntu distribution codename to compile for
required: true
ARCH:
type: string
description: CPU architecture
required: true

jobs:
build:
uses: ./.github/workflows/build.yaml
with:
DEB_DISTRO: ${{ inputs.DEB_DISTRO }}
ROS_SOURCES: ros-one.repos
ARCH: ${{ inputs.ARCH }}
INSTALL_GPG_KEYS: |
sudo curl -sSL https://ros.packages.techfak.net/gpg.key -o /etc/apt/keyrings/ros-one-keyring.gpg
sudo mkdir -p /etc/ros/rosdep/sources.list.d
echo "yaml https://ros.packages.techfak.net/ros-one.yaml ${{ inputs.DEB_DISTRO }}" | sudo tee /etc/ros/rosdep/sources.list.d/1-ros-one.list
EXTRA_DEB_SOURCES: "deb [signed-by=/etc/apt/keyrings/ros-one-keyring.gpg] https://ros.packages.techfak.net ${{inputs.DEB_DISTRO}}-testing main"
# proceed from existing debs artifact if run_attempt > 1
DOWNLOAD_DEBS: ${{ github.run_attempt != '1' }}
DEBS_ARTIFACT_NAME: ${{ inputs.DEB_DISTRO }}-debs
SKIP_EXISTING: true
SKIP_KNOWN_FAILING: true
CONTINUE_ON_ERROR: true
INSTALL_TO_CHROOT: false

deploy:
needs: build
if: always() && vars.DEPLOY_URL
timeout-minutes: 15
runs-on: ubuntu-latest
concurrency:
# Ensure exclusive access to deployment target
group: ${{ vars.DEPLOY_URL }}
cancel-in-progress: false
steps:
- name: Import build artifacts to reprepro server
uses: ./reprepro@main
with:
url: "${{ vars.DEPLOY_URL }}?distro=${{ inputs.DEB_DISTRO }}&run_id=${{ github.run_id }}&arch=${{ inputs.ARCH }}"

0 comments on commit fefa510

Please sign in to comment.