Skip to content

Commit 22af350

Browse files
committed
Merge branch 'jazzy-devel-sim' into jazzy-devel-hw
2 parents 5f36dd4 + 61f50b3 commit 22af350

File tree

68 files changed

+886
-541
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+886
-541
lines changed

.github/workflows/build-docker.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ name: Build Docker
44
on:
55
workflow_call:
66
inputs:
7+
branch_name:
8+
description: Tag used in the docker image (branch/tag/commit).
9+
required: true
10+
type: string
711
build_type:
812
description: Is it a "development" or a "stable" release?
913
required: true
@@ -58,10 +62,11 @@ jobs:
5862
include:
5963
- dockerfile: ./docker/Dockerfile.hardware
6064
platforms: linux/arm64
65+
repo_name: husarion-ugv
6166
ros_distro: humble
6267
- dockerfile: ./docker/Dockerfile.simulation
63-
repo_name: panther-gazebo
6468
platforms: linux/amd64
69+
repo_name: husarion-ugv-gazebo
6570
ros_distro: humble
6671

6772
steps:
@@ -76,6 +81,7 @@ jobs:
7681
main_branch_name: ros2
7782
dockerfile: ${{ matrix.dockerfile }}
7883
repo_name: ${{ matrix.repo_name }}
84+
branch_name: ${{ inputs.branch_name }}
7985
build_type: ${{ inputs.build_type }}
8086
ros_distro: ${{ matrix.ros_distro }}
8187
platforms: ${{ matrix.platforms }}

.github/workflows/release-candidate.yaml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
required: true
1313

1414
env:
15-
RC_BRANCH_NAME: ${{ github.event.inputs.version }}-${{ github.event.inputs.date }}
15+
RC_BRANCH_NAME: ${{ inputs.version }}-${{ inputs.date }}
1616

1717
jobs:
1818
docs:
@@ -29,16 +29,15 @@ jobs:
2929
ref: master
3030
client_payload: '{"husarion_ugv_branch": "ros2-devel"}'
3131

32-
# TODO: Add unit testing when ready
3332
unit_tests:
3433
name: Unit tests
3534
runs-on: ubuntu-22.04
3635
steps:
3736
- name: Run unit tests
3837
run: echo "Unit tests are not fully implemented yet -> SKIPPING!"
3938

40-
docker:
41-
name: Docker
39+
update_compose_files:
40+
name: Update compose files
4241
needs: unit_tests
4342
runs-on: ubuntu-22.04
4443
steps:
@@ -59,14 +58,17 @@ jobs:
5958
author_email: action-bot@action-bot.com
6059
new_branch: ${{ env.RC_BRANCH_NAME }}
6160

62-
- name: Build Docker
63-
uses: ./.github/workflows/build-docker.yaml
64-
with:
65-
build_type: development
61+
build_docker:
62+
name: Build Docker
63+
needs: update_compose_files
64+
uses: ./.github/workflows/build-docker.yaml
65+
with:
66+
branch_name: ${{ inputs.version }}-${{ inputs.date }}
67+
build_type: development
6668

6769
os_image:
6870
name: OS image
69-
needs: docker
71+
needs: update_compose_files
7072
runs-on: ubuntu-22.04
7173
steps:
7274
- name: Create new branch
@@ -90,7 +92,7 @@ jobs:
9092
{
9193
"dev_image": "true",
9294
"husarion_ugv_version": "${{ env.RC_BRANCH_NAME }}",
93-
"image_tag": "${{ github.event.inputs.version }}"
95+
"image_tag": "${{ inputs.version }}"
9496
}
9597
9698
- name: Build flash OS image
@@ -103,5 +105,5 @@ jobs:
103105
ref: ${{ env.RC_BRANCH_NAME }}
104106
client_payload: |
105107
{
106-
"image_tag": "${{ github.event.inputs.version }}"
108+
"image_tag": "${{ inputs.version }}"
107109
}

.github/workflows/release-project.yaml

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,41 @@ on:
2626
description: Mark the release as a prerelease.
2727

2828
env:
29-
RC_BRANCH_NAME: ${{ github.event.inputs.version }}-${{ github.event.inputs.date }}
29+
RC_BRANCH_NAME: ${{ inputs.version }}-${{ inputs.date }}
3030
MAIN_BRANCH: ros2
3131

3232
jobs:
33+
release_repository:
34+
name: Release repository
35+
uses: ./.github/workflows/release-repository.yaml
36+
with:
37+
release_candidate: ${{ env.RC_BRANCH_NAME }}
38+
version: ${{ inputs.version }}
39+
release_name: ${{ inputs.release_name }}
40+
automatic_mode: ${{ inputs.automatic_mode }}
41+
prerelease: ${{ inputs.prerelease }}
42+
43+
build_docker:
44+
name: Build Docker
45+
needs: release_repository
46+
uses: ./.github/workflows/build-docker.yaml
47+
with:
48+
build_type: development
49+
50+
tag_docker_as_stable:
51+
name: Tag Docker as stable
52+
needs: build_docker
53+
uses: ./.github/workflows/build-docker.yaml
54+
with:
55+
build_type: stable
56+
target_distro: humble
57+
target_release: ${{ inputs.version }}
58+
target_date: ${{ inputs.date }}
59+
3360
release_project:
3461
name: Release project
3562
runs-on: ubuntu-22.04
3663
steps:
37-
- name: Release repository
38-
uses: ./.github/workflows/release-repository.yaml
39-
with:
40-
release_candidate: ${{ env.RC_BRANCH_NAME }}
41-
version: ${{ github.event.inputs.version }}
42-
release_name: ${{ github.event.inputs.release_name }}
43-
automatic_mode: ${{ github.event.inputs.automatic_mode }}
44-
prerelease: ${{ github.event.inputs.prerelease }}
45-
46-
- name: Build Docker with new version
47-
uses: ./.github/workflows/build-docker.yaml
48-
with:
49-
build_type: development
50-
5164
- name: Release panther-rpi-os-img repository
5265
uses: convictional/trigger-workflow-and-wait@v1.6.5
5366
with:
@@ -59,14 +72,14 @@ jobs:
5972
client_payload: |
6073
{
6174
"release_candidate": "${{ env.RC_BRANCH_NAME }}",
62-
"version": "${{ github.event.inputs.version }}",
63-
"release_name": "${{ github.event.inputs.release_name }}",
64-
"automatic_mode": "${{ github.event.inputs.automatic_mode }}",
65-
"prerelease": "${{ github.event.inputs.prerelease }}"
75+
"version": "${{ inputs.version }}",
76+
"release_name": "${{ inputs.release_name }}",
77+
"automatic_mode": "${{ inputs.automatic_mode }}",
78+
"prerelease": "${{ inputs.prerelease }}"
6679
}
6780
6881
- name: Build OS image
69-
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }}
82+
if: ${{ inputs.automatic_mode }}
7083
uses: convictional/trigger-workflow-and-wait@v1.6.5
7184
with:
7285
owner: husarion
@@ -77,12 +90,12 @@ jobs:
7790
client_payload: |
7891
{
7992
"dev_image": "false",
80-
"husarion_ugv_version": "${{ github.event.inputs.version }}",
81-
"image_tag": "${{ github.event.inputs.version }}"
93+
"husarion_ugv_version": "${{ inputs.version }}",
94+
"image_tag": "${{ inputs.version }}"
8295
}
8396
8497
- name: Build flash OS image
85-
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }}
98+
if: ${{ inputs.automatic_mode }}
8699
uses: convictional/trigger-workflow-and-wait@v1.6.5
87100
with:
88101
owner: husarion
@@ -92,9 +105,13 @@ jobs:
92105
ref: ${{ env.MAIN_BRANCH }}
93106
client_payload: |
94107
{
95-
"image_tag": "${{ github.event.inputs.version }}"
108+
"image_tag": "${{ inputs.version }}"
96109
}
97110
111+
docs:
112+
name: Docs
113+
runs-on: ubuntu-22.04
114+
steps:
98115
- name: Rebuild documentation
99116
uses: convictional/trigger-workflow-and-wait@v1.6.5
100117
with:

.github/workflows/release-repository.yaml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,89 +38,84 @@ jobs:
3838
- name: Checkout to rc branch
3939
uses: actions/checkout@v4
4040
with:
41-
ref: ${{ github.event.inputs.release_candidate }}
41+
ref: ${{ inputs.release_candidate }}
4242

4343
- name: Catkin release
4444
id: catkin_release
4545
uses: at-wat/catkin-release-action@v1
4646
with:
47-
version: ${{ github.event.inputs.version }}
47+
version: ${{ inputs.version }}
4848
git_user: action-bot
4949
git_email: action-bot@action-bot.com
5050
github_token: ${{ secrets.GITHUB_TOKEN }}
5151

5252
- name: Catkin release - create PR
5353
run: |
5454
gh pr create \
55-
--base ${{ github.event.inputs.release_candidate }} \
55+
--base ${{ inputs.release_candidate }} \
5656
--head ${{ steps.catkin_release.outputs.created_branch }} \
5757
--title "Release ${{ steps.catkin_release.outputs.version}}" \
5858
--body "This PR incorporates package(s) version and changelog update."
5959
6060
- name: Catkin release - merge PR
61-
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }}
61+
if: ${{ inputs.automatic_mode }}
6262
run: |
6363
gh pr merge ${{ steps.catkin_release.outputs.created_branch }} \
6464
--merge --delete-branch
6565
6666
- name: Grant permissions # Required permission grant after at-wat/catkin-release-action@v1 action
67-
if: ${{ fromJSON(inputs.automatic_mode) == true }}
67+
if: ${{ inputs.automatic_mode }}
6868
run: |
6969
sudo chmod -R ugo+rwX .
7070
7171
- name: Checkout to main branch
72-
if: ${{ github.event.inputs.release_candidate != env.MAIN_BRANCH && fromJSON(inputs.automatic_mode)
73-
== true }}
72+
if: ${{ inputs.release_candidate != env.MAIN_BRANCH && inputs.automatic_mode }}
7473
uses: actions/checkout@v4
7574
with:
7675
ref: ${{ env.MAIN_BRANCH }}
7776
fetch-depth: 0
7877

7978
- name: Create PR to main branch
80-
if: ${{ github.event.inputs.release_candidate != env.MAIN_BRANCH && fromJSON(inputs.automatic_mode)
81-
== true }}
79+
if: ${{ inputs.release_candidate != env.MAIN_BRANCH && inputs.automatic_mode }}
8280
run: |
8381
gh pr create \
8482
--base ${{ env.MAIN_BRANCH }} \
85-
--head ${{ github.event.inputs.release_candidate }} \
83+
--head ${{ inputs.release_candidate }} \
8684
--title "Release ${{ steps.catkin_release.outputs.version}} to ${{ env.MAIN_BRANCH }}" \
8785
--body "This PR incorporates package(s) version and changelog update."
8886
8987
- name: Merge PR to main branch
90-
if: ${{ github.event.inputs.release_candidate != env.MAIN_BRANCH && fromJSON(inputs.automatic_mode)
91-
== true }}
88+
if: ${{ inputs.release_candidate != env.MAIN_BRANCH && inputs.automatic_mode }}
9289
run: |
93-
gh pr merge ${{ github.event.inputs.release_candidate }} \
90+
gh pr merge ${{ inputs.release_candidate }} \
9491
--merge --delete-branch
9592
9693
- name: Create prerelease
97-
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease)
98-
== true}}
94+
if: ${{ inputs.automatic_mode && inputs.prerelease}}
9995
run: |
10096
gh release create ${{ steps.catkin_release.outputs.version }} \
10197
--target ${{ env.MAIN_BRANCH }} \
102-
--title ${{ github.event.inputs.release_name }} \
98+
--title ${{ inputs.release_name }} \
10399
--generate-notes \
104100
--prerelease
105101
106102
- name: Create release
107-
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease)
108-
== false}}
103+
if: ${{ inputs.automatic_mode && !inputs.prerelease }}
109104
run: |
110105
gh release create ${{ steps.catkin_release.outputs.version }} \
111106
--target ${{ env.MAIN_BRANCH }} \
112-
--title ${{ github.event.inputs.release_name }} \
107+
--title ${{ inputs.release_name }} \
113108
--generate-notes
114109
115110
- name: Checkout to devel branch
116-
if: ${{ env.DEVEL_BRANCH != env.MAIN_BRANCH && fromJSON(inputs.automatic_mode) == true }}
111+
if: ${{ env.DEVEL_BRANCH != env.MAIN_BRANCH && inputs.automatic_mode }}
117112
uses: actions/checkout@v4
118113
with:
119114
ref: ${{ env.DEVEL_BRANCH }}
120115
fetch-depth: 0
121116

122117
- name: Update devel branch
123-
if: ${{ env.DEVEL_BRANCH != env.MAIN_BRANCH && fromJSON(inputs.automatic_mode) == true }}
118+
if: ${{ env.DEVEL_BRANCH != env.MAIN_BRANCH && inputs.automatic_mode }}
124119
run: |
125120
git pull origin ${{ env.MAIN_BRANCH }}
126121
git push origin ${{ env.DEVEL_BRANCH }}

.github/workflows/run-unit-tests.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
name: Run unit tests
3+
4+
on:
5+
push:
6+
workflow_call:
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-test:
11+
name: Run unit tests ${{ matrix.build_type }} build type
12+
runs-on: ubuntu-22.04
13+
strategy:
14+
matrix:
15+
build_type: [simulation, hardware]
16+
17+
env:
18+
HUSARION_ROS_BUILD_TYPE: ${{ matrix.build_type }}
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- uses: ros-tooling/setup-ros@v0.7
25+
with:
26+
use-ros2-testing: true
27+
28+
- name: Build and test
29+
uses: ros-tooling/action-ros-ci@v0.3
30+
id: build_test_1
31+
with:
32+
vcs-repo-file-url: ${{ github.workspace }}/husarion_ugv/${{ env.HUSARION_ROS_BUILD_TYPE }}_deps.repos
33+
target-ros2-distro: humble
34+
colcon-defaults: |
35+
{
36+
"build": {
37+
"packages-up-to": ["husarion_ugv"],
38+
"cmake-args": ["-DCMAKE_BUILD_TYPE=Release"]
39+
},
40+
"test": {
41+
"packages-up-to": ["husarion_ugv"]
42+
}
43+
}
44+
45+
continue-on-error: true
46+
47+
- name: Retry Build and test (if failed)
48+
if: steps.build_test_1.outcome == 'failure'
49+
uses: ros-tooling/action-ros-ci@v0.3
50+
with:
51+
vcs-repo-file-url: ${{ github.workspace }}/husarion_ugv/${{ env.HUSARION_ROS_BUILD_TYPE }}_deps.repos
52+
target-ros2-distro: humble
53+
colcon-defaults: |
54+
{
55+
"build": {
56+
"packages-up-to": ["husarion_ugv"],
57+
"cmake-args": ["-DCMAKE_BUILD_TYPE=Release"]
58+
},
59+
"test": {
60+
"packages-up-to": ["husarion_ugv"]
61+
}
62+
}

0 commit comments

Comments
 (0)