-
Notifications
You must be signed in to change notification settings - Fork 3
74 lines (71 loc) · 2.64 KB
/
reusable-debian-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Reusable Debian Source Build
# Reusable workflow to simplify dealing with debian source builds
# author: Christoph Froehlich <[email protected]>
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
- id: package_list_action
uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@master
with:
path: ${{ env.path }}
- name: Build workspace
shell: bash
run: |
source /opt/ros2_ws/install/setup.bash
colcon build --packages-up-to ${{ steps.package_list_action.outputs.package_list }} --packages-skip ${{ inputs.skip_packages }}
- name: Test workspace
shell: bash
run: |
source /opt/ros2_ws/install/setup.bash
colcon test --packages-select ${{ steps.package_list_action.outputs.package_list }} --packages-skip ${{ inputs.skip_packages }} ${{ inputs.skip_packages_test }}
colcon test-result --verbose