Skip to content

Commit

Permalink
Merge remote-tracking branch 'ubi-agni/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/interactive.yaml
#	ros-one.repos
  • Loading branch information
ojura committed Oct 23, 2024
2 parents 17f7564 + 4ef104c commit b33bcd3
Show file tree
Hide file tree
Showing 41 changed files with 11,734 additions and 208 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ on:
description: Continue building from previous debs artifact?
required: true
default: false
CONTINUE_FROM_PKG:
type: string
description: package to continue building from
required: false
INSTALL_TO_CHROOT:
type: boolean
description: Incrementally install built packages within the chroot?
Expand Down Expand Up @@ -127,6 +131,7 @@ jobs:
runs-on: self-hosted
# runs-on: ${{ inputs.ARCH == 'x64' && 'ubuntu-22.04' || inputs.ARCH }}
name: build debs
continue-on-error: true
outputs:
LATEST_PACKAGE: ${{ steps.build.outputs.LATEST_PACKAGE }}

Expand All @@ -146,16 +151,15 @@ jobs:
name: debs
path: ${{ env.DEBS_PATH }}

- name: Determine CCACHE_ID
id: ccache-id
run: echo "CCACHE_ID=ccache-${DEB_DISTRO}-$(dpkg --print-architecture)-${ROS_SOURCES}" | tee -a "$GITHUB_OUTPUT"
- name: Restore ccache
id: restore-ccache
uses: actions/cache/restore@v4
env:
CCACHE_ID: "ccache-${{ inputs.DEB_DISTRO || vars.DEB_DISTRO }}-${{ inputs.ROS_SOURCES || vars.ROS_SOURCES }}"
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ env.CCACHE_ID }}-${{ github.run_id }}
restore-keys: |
${{ env.CCACHE_ID }}
key: ${{ steps.ccache-id.outputs.CCACHE_ID }}

- name: Build .deb packages
uses: larics/ros-builder-action@main
Expand All @@ -165,6 +169,7 @@ jobs:
BUILD_TIMEOUT: ${{ inputs.BUILD_TIMEOUT || vars.BUILD_TIMEOUT }}
env:
COLCON_PKG_SELECTION: ${{ inputs.COLCON_PKG_SELECTION || vars.COLCON_PKG_SELECTION || '' }}
CONTINUE_FROM_PKG: ${{ inputs.CONTINUE_FROM_PKG }}
EXTRA_SBUILD_CONFIG: ${{ inputs.EXTRA_SBUILD_CONFIG || vars.EXTRA_SBUILD_CONFIG }}
EXTRA_SBUILD_OPTS: ${{ inputs.EXTRA_SBUILD_OPTS || vars.EXTRA_SBUILD_OPTS }}
DEB_BUILD_OPTIONS: ${{ inputs.DEB_BUILD_OPTIONS || vars.DEB_BUILD_OPTIONS || 'nocheck' }}
Expand All @@ -177,6 +182,12 @@ jobs:
if: always() # always prepare files for upload
run: find ${{ env.DEBS_PATH }} -name '*[<>:"\\|?*]*' -print -delete

- 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 }}"
env:
GH_TOKEN: ${{ github.token }}
- name: Store ccache
uses: actions/cache/save@v4
if: always() # save cache on timeout or cancel too
Expand All @@ -191,4 +202,5 @@ jobs:
with:
name: ${{ inputs.DEBS_ARTIFACT_NAME || 'debs' }}
path: ${{ env.DEBS_PATH }}
overwrite: true
if-no-files-found: error
14 changes: 2 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,7 @@ jobs:
with:
submodules: recursive
- run: ./test/bats/bin/bats --formatter pretty test/*.bats

- name: Check that *.js scripts are all identical to main.js
run: |
err=0
for f in $(find . -iname "*.js" -not -path "./node_modules/*"); do
if ! diff -q $f main.js; then
echo "::warning:: $f differs from main.js"
err=1
fi
done
exit $err
- run: test/redirect.sh

build:
needs: unittests
Expand Down Expand Up @@ -107,7 +97,7 @@ jobs:
if: ${{ !cancelled() }}
uses: ubi-agni/ros-builder-action/.github/workflows/deploy.yaml@main
with:
DEBS_ARTIFACT_NAME: ${{ matrix.NAME }}
DEBS_ARTIFACT_NAME: skip
DEPLOY_URL: self#ci
PUSH_MODE: ${{ matrix.PUSH_MODE }}
MESSAGE: "ci: ${{ matrix.NAME }} ${{ matrix.PUSH_MODE }}"
7 changes: 7 additions & 0 deletions .github/workflows/good.repos
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ repositories:
type: git
url: https://github.com/ubi-agni/catkin
version: noetic-devel
catkin_tools:
type: git
url: https://github.com/catkin/catkin_tools
version: main
genmsg:
type: git
url: https://github.com/ros/genmsg.git
Expand All @@ -15,3 +19,6 @@ repositories:
type: git
url: https://github.com/ros/roscpp_core.git
version: noetic-devel

sbuild_options:
genmsg: --jobs=2
64 changes: 61 additions & 3 deletions .github/workflows/interactive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ on:
required: false

jobs:
build:
name: ${{ inputs.DEB_DISTRO || vars.DEB_DISTRO || 'latest' }}-${{ inputs.ROS_DISTRO || vars.ROS_DISTRO || 'one'}}
build-1:
uses: larics/ros-builder-action/.github/workflows/build.yaml@main
with:
DEB_DISTRO: ${{ inputs.DEB_DISTRO || vars.DEB_DISTRO }}
Expand All @@ -75,11 +74,70 @@ jobs:
sudo mkdir -p /etc/ros/rosdep/sources.list.d
echo "yaml https://ros.packages.techfak.net/ros-one.yaml ${{ inputs.DEB_DISTRO || vars.DEB_DISTRO || '' }}" | sudo tee /etc/ros/rosdep/sources.list.d/1-ros-one.list
EXTRA_DEB_SOURCES: "${{ inputs.CONTINUE_BUILD && \
format('deb [signed-by=/etc/apt/keyrings/ros-one-keyring.gpg] https://ros.packages.techfak.net {0}-build main', \
format('deb [signed-by=/etc/apt/keyrings/ros-one-keyring.gpg] https://ros.packages.techfak.net {0}-testing main', \
inputs.DEB_DISTRO || vars.DEB_DISTRO) || '' }}"
COLCON_PKG_SELECTION: ${{ inputs.COLCON_PKG_SELECTION || vars.COLCON_PKG_SELECTION || '' }}
# proceed from existing debs artifact if run_attempt > 1
DOWNLOAD_DEBS: ${{ github.run_attempt != '1' }}
SKIP_EXISTING: ${{ inputs.SKIP_EXISTING }}
CONTINUE_ON_ERROR: ${{ inputs.CONTINUE_ON_ERROR }}
INSTALL_TO_CHROOT: ${{ inputs.INSTALL_TO_CHROOT || vars.INSTALL_TO_CHROOT || false }}

build-2:
needs: build-1
uses: larics/ros-builder-action/.github/workflows/build.yaml@main
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
sudo mkdir -p /etc/ros/rosdep/sources.list.d
echo "yaml https://ros.packages.techfak.net/ros-one.yaml ${{ inputs.DEB_DISTRO || vars.DEB_DISTRO || '' }}" | sudo tee /etc/ros/rosdep/sources.list.d/1-ros-one.list
EXTRA_DEB_SOURCES: "${{ inputs.CONTINUE_BUILD && \
format('deb [signed-by=/etc/apt/keyrings/ros-one-keyring.gpg] https://ros.packages.techfak.net {0}-testing main', \
inputs.DEB_DISTRO || vars.DEB_DISTRO) || '' }}"
COLCON_PKG_SELECTION: ${{ inputs.COLCON_PKG_SELECTION || vars.COLCON_PKG_SELECTION || '' }}
CONTINUE_FROM_PKG: ${{ needs.build-1.outputs.LATEST_PACKAGE }}
DOWNLOAD_DEBS: true
SKIP_EXISTING: ${{ inputs.SKIP_EXISTING }}
CONTINUE_ON_ERROR: ${{ inputs.CONTINUE_ON_ERROR }}
INSTALL_TO_CHROOT: ${{ inputs.INSTALL_TO_CHROOT || vars.INSTALL_TO_CHROOT || false }}

build-3:
needs: build-2
uses: larics/ros-builder-action/.github/workflows/build.yaml@main
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
sudo mkdir -p /etc/ros/rosdep/sources.list.d
echo "yaml https://ros.packages.techfak.net/ros-one.yaml ${{ inputs.DEB_DISTRO || vars.DEB_DISTRO || '' }}" | sudo tee /etc/ros/rosdep/sources.list.d/1-ros-one.list
EXTRA_DEB_SOURCES: "${{ inputs.CONTINUE_BUILD && \
format('deb [signed-by=/etc/apt/keyrings/ros-one-keyring.gpg] https://ros.packages.techfak.net {0}-testing main', \
inputs.DEB_DISTRO || vars.DEB_DISTRO) || '' }}"
COLCON_PKG_SELECTION: ${{ inputs.COLCON_PKG_SELECTION || vars.COLCON_PKG_SELECTION || '' }}
CONTINUE_FROM_PKG: ${{ needs.build-2.outputs.LATEST_PACKAGE }}
DOWNLOAD_DEBS: true
SKIP_EXISTING: ${{ inputs.SKIP_EXISTING }}
CONTINUE_ON_ERROR: ${{ inputs.CONTINUE_ON_ERROR }}
INSTALL_TO_CHROOT: ${{ inputs.INSTALL_TO_CHROOT || vars.INSTALL_TO_CHROOT || false }}

deploy:
needs: build-3
if: success() && 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: larics/ros-builder-action/reprepro@main
with:
url: "${{ vars.DEPLOY_URL }}?distro=${{ inputs.DEB_DISTRO || vars.DEB_DISTRO }}&run_id=${{ github.run_id }}&arch=${{ inputs.ARCH || vars.ARCH || 'x64' }}"
2 changes: 1 addition & 1 deletion action.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: ROS buildfarm
description: Github action to build .deb packages from ROS sources
description: GitHub action to build .deb packages from ROS sources
author: Robert Haschke
branding:
icon: 'package'
Expand Down
6 changes: 4 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ child.on('exit', function (exit_code, signal) {
exit_code = exit_code !== null ? exit_code : 143
const suffix = exit_code == expect ? ' (as expected)' : ' != ' + expect
const msg = 'Process finished with code ' + exit_code + suffix
exit_code == expect ? core.debug(msg) : core.warning(msg)
process.exit(exit_code == expect ? 0 : 1)

const success = exit_code == expect || exit_code == 143
success ? core.debug(msg) : core.warning(msg)
process.exit(success ? 0 : 1)
})

// cancel build after given timout (github default: 6h - 20min slack)
Expand Down
9 changes: 9 additions & 0 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

ici_setup_vars "${VERBOSE:-}" "${DEFAULT_QUIET_CONFIG[@]}"

if [ "$CONTINUE_FROM_PKG" == "DONE" ]; then
gha_report_result "LATEST_PACKAGE" "DONE"
ici_log "$(ici_colorize GREEN "Skipping build stage (already done)")"
ici_exit 0
elif [ "$CONTINUE_FROM_PKG" != "" ]; then
COLCON_PKG_SELECTION="$COLCON_PKG_SELECTION --packages-start $CONTINUE_FROM_PKG"
fi


ici_start_fold "Variables"
cat <<EOF
ROS_DISTRO=$ROS_DISTRO
Expand Down
8 changes: 8 additions & 0 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions node_modules/eventsource/.editorconfig

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions node_modules/eventsource/CONTRIBUTING.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b33bcd3

Please sign in to comment.