-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use reusable wfs for debian and RHEL
- Loading branch information
1 parent
a7a2d02
commit ddc63b1
Showing
8 changed files
with
224 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Reusable Debian Source Build | ||
# Reusable action to simplify dealing with debian source builds | ||
# author: Christoph Froehlich <christoph.froehlich@ait.ac.at> | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ros_distro: | ||
description: 'ROS2 distribution name' | ||
required: true | ||
type: string | ||
ref_for_scheduled_build: | ||
description: 'Reference on which the repo should be checkout for scheduled build. Usually is this name of a branch or a tag.' | ||
default: '' | ||
required: false | ||
type: string | ||
upstream_workspace: | ||
description: 'Path to local .repos file.' | ||
default: '' | ||
required: false | ||
type: string | ||
skip_packages: | ||
description: 'Packages to skip from build and test' | ||
default: '' | ||
required: false | ||
type: string | ||
skip_packages_test: | ||
description: 'Packages to skip from test additionally to skip_packages' | ||
default: '' | ||
required: false | ||
type: string | ||
|
||
|
||
jobs: | ||
debian_source: | ||
name: ${{ inputs.ros_distro }} debian build | ||
runs-on: ubuntu-latest | ||
env: | ||
# this will be src/{repo-owner}/{repo-name} | ||
path: src/${{ github.repository }} | ||
container: ghcr.io/ros-controls/ros:${{ inputs.ros_distro }}-debian | ||
steps: | ||
- name: Checkout default ref when build is not scheduled | ||
if: ${{ github.event_name != 'schedule' }} | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ${{ env.path }} | ||
- name: Checkout ${{ inputs.ref_for_scheduled_build }} on scheduled build | ||
if: ${{ github.event_name == 'schedule' }} | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref_for_scheduled_build }} | ||
path: ${{ env.path }} | ||
- name: Import upstream workspace | ||
shell: bash | ||
run: | | ||
if [[ -n "${{ inputs.upstream_workspace }}" ]]; then | ||
vcs import src < ${{ env.path }}/${{ inputs.upstream_workspace }} | ||
fi | ||
- name: Get list of packages | ||
# we need both paths, there is no wildcard/glob for packages defined in the root folder and subfolders at the same time | ||
run: | | ||
echo "package_list=$(colcon list --paths ${{ env.path }} --names-only) $(colcon list --paths ${{ env.path }}/* --names-only)" >> $GITHUB_ENV | ||
- name: Build workspace | ||
shell: bash | ||
run: | | ||
source /opt/ros2_ws/install/setup.bash | ||
colcon build --packages-up-to ${{ env.package_list }} --packages-skip ${{ inputs.skip_packages }} | ||
- name: Test workspace | ||
shell: bash | ||
continue-on-error: true | ||
run: | | ||
source /opt/ros2_ws/install/setup.bash | ||
colcon test --packages-select ${{ env.package_list }} --packages-skip ${{ inputs.skip_packages }} ${{ inputs.skip_packages_test }} | ||
colcon test-result --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Reusable RHEL Binary Build | ||
# Reusable action to simplify dealing with RHEL binary builds | ||
# author: Christoph Froehlich <christoph.froehlich@ait.ac.at> | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ros_distro: | ||
description: 'ROS2 distribution name' | ||
required: true | ||
type: string | ||
ref_for_scheduled_build: | ||
description: 'Reference on which the repo should be checkout for scheduled build. Usually is this name of a branch or a tag.' | ||
default: '' | ||
required: false | ||
type: string | ||
upstream_workspace: | ||
description: 'Path to local .repos file.' | ||
default: '' | ||
required: false | ||
type: string | ||
skip_packages: | ||
description: 'Packages to skip from build and test' | ||
default: '' | ||
required: false | ||
type: string | ||
skip_packages_test: | ||
description: 'Packages to skip from test additionally to skip_packages' | ||
default: '' | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
rhel_binary: | ||
name: ${{ inputs.ros_distro }} RHEL binary build | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/ros-controls/ros:${{ inputs.ros_distro }}-rhel | ||
env: | ||
# this will be src/{repo-owner}/{repo-name} | ||
path: src/${{ github.repository }} | ||
steps: | ||
- name: Checkout default ref when build is not scheduled | ||
if: ${{ github.event_name != 'schedule' }} | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ${{ env.path }} | ||
- name: Checkout ${{ inputs.ref_for_scheduled_build }} on scheduled build | ||
if: ${{ github.event_name == 'schedule' }} | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref_for_scheduled_build }} | ||
path: ${{ env.path }} | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
source /opt/ros/${{ inputs.ros_distro }}/setup.bash | ||
source /opt/ros2_ws/install/local_setup.bash | ||
if [[ -n "${{ inputs.upstream_workspace }}" ]]; then | ||
vcs import src < ${{ env.path }}/${{ inputs.upstream_workspace }} | ||
fi | ||
rosdep update | ||
rosdep install -iyr --from-path src || true | ||
- name: Get list of packages | ||
# we need both paths, there is no wildcard/glob for packages defined in the root folder and subfolders at the same time | ||
run: | | ||
echo "package_list=$(colcon list --paths ${{ env.path }} --names-only) $(colcon list --paths ${{ env.path }}/* --names-only)" >> $GITHUB_ENV | ||
- name: Build workspace | ||
shell: bash | ||
# source also underlay workspace with generate_parameter_library on rhel9 | ||
run: | | ||
source /opt/ros/${{ inputs.ros_distro }}/setup.bash | ||
source /opt/ros2_ws/install/local_setup.bash | ||
colcon build --packages-up-to ${{ env.package_list }} --packages-skip ${{ inputs.skip_packages }} | ||
- name: Test workspace | ||
shell: bash | ||
continue-on-error: true | ||
run: | | ||
source /opt/ros/${{ inputs.ros_distro }}/setup.bash | ||
source /opt/ros2_ws/install/local_setup.bash | ||
colcon test --packages-select ${{ env.package_list }} --packages-skip ${{ inputs.skip_packages }} ${{ inputs.skip_packages_test }} | ||
colcon test-result --verbose |
Oops, something went wrong.