forked from ubi-agni/ros-builder-action
-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (136 loc) · 6.44 KB
/
interactive.yaml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: interactive
run-name: "interactive: ${{ inputs.DEB_DISTRO || vars.DEB_DISTRO }}-${{ inputs.ROS_DISTRO || vars.ROS_DISTRO || 'one'}} ${{ inputs.ROS_SOURCES || vars.ROS_SOURCES }}"
on:
workflow_dispatch:
# The inputs should not define a default value.
# If they do, this value would be passed even if nothing is actually entered in the dialog,
# thus overriding any configuration variables set, which should be considered in this case.
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatchinputs
inputs:
# target distro
DEB_DISTRO:
type: string
required: true
description: 'Ubuntu/Debian distro:'
default: noble
ROS_DISTRO:
type: string
required: true
description: 'ROS distribution codename:'
default: one
ARCH:
type: choice
required: true
description: 'Architecture:'
default: x64
options:
- x64
- arm64
# source selection
ROS_SOURCES:
type: string
description: 'ROS sources to compile:'
required: true
default: '*.repos'
COLCON_PKG_SELECTION:
type: string
description: 'colcon package selection:'
required: false
# build flow control
CONTINUE_BUILD:
type: boolean
description: Continue previous build?
required: true
default: true
SKIP_EXISTING:
type: boolean
description: Skip already built packages?
required: false
default: true
CONTINUE_ON_ERROR:
type: boolean
description: Continue on build errors?
required: false
default: true
# Installing built packages to chroot speeds up downstream builds?
INSTALL_TO_CHROOT:
type: boolean
description: Incrementally fill chroot?
required: false
jobs:
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 || '' }}
# 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' }}"