Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

Commit 05a071e

Browse files
authored
Consolidate Workflows (#65)
* Test consolidation Signed-off-by: Devin Bonnie <[email protected]> * Add build type to job name Signed-off-by: Devin Bonnie <[email protected]> * Only run release latest on schedule Signed-off-by: Devin Bonnie <[email protected]> * Update job name to include branch Signed-off-by: Devin Bonnie <[email protected]> * Revert "Update job name to include branch" This reverts commit 9cfe93b. * only upload artifacts if they have been generated Signed-off-by: Devin Bonnie <[email protected]> * Fix reporting value Update build_type name Signed-off-by: Devin Bonnie <[email protected]> * Add documentation and minor cleanups Signed-off-by: Devin Bonnie <[email protected]> * Revert bumping action-ros-ci version Signed-off-by: Devin Bonnie <[email protected]> * Update comment Signed-off-by: Devin Bonnie <[email protected]>
1 parent 3d9bd8d commit 05a071e

File tree

2 files changed

+39
-99
lines changed

2 files changed

+39
-99
lines changed

.github/workflows/build_and_test.yml

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@ on:
77
schedule:
88
# Run every hour. This helps detect flakiness,
99
# and broken external dependencies.
10+
# Only triggered for the master branch
1011
- cron: '0 * * * *'
1112

1213
jobs:
13-
build_and_test_master:
14-
name: Build and Test Master ROS ${{ matrix.ros_version }} ${{ matrix.ros_distro }}
14+
build_and_test:
15+
name: Build and Test ROS ${{ matrix.ros_version }} ${{ matrix.ros_distro }} ${{ matrix.build_type }}
1516
runs-on: ubuntu-latest
1617
strategy:
1718
fail-fast: false
1819
matrix:
1920
ros_distro: [kinetic, melodic, dashing]
21+
build_type: [master, release-latest]
2022
include:
2123
- ros_distro: kinetic
2224
ubuntu_distro: xenial
@@ -32,23 +34,40 @@ jobs:
3234
extra_cmake_args: ""
3335
container:
3436
image: rostooling/setup-ros-docker:ubuntu-${{ matrix.ubuntu_distro }}-ros-${{ matrix.ros_distro }}-ros-base-latest
35-
outputs:
36-
build_result: ${{ steps.build.outcome }}
37-
test_result: ${{ steps.test.outcome }}
37+
env:
38+
# Needed for the CMakeLists.txt setup
39+
ROS_DISTRO: ${{ matrix.ros_distro }}
40+
ROS_VERSION: ${{ matrix.ros_version }}
3841
steps:
3942
# TODO(setup-ros-docker#7): calling chown is necessary for now
40-
- run: sudo chown -R rosbuild:rosbuild "$HOME" .
41-
# Needed for the CMakeLists.txt setup
42-
- run: export ROS_DISTRO=${{ matrix.ros_distro }}
43-
# Needed for the CMakeLists.txt setup
44-
- run: export ROS_VERSION=${{ matrix.ros_version }}
45-
- uses: ros-tooling/[email protected]
43+
- name: setup-ros-docker workaround
44+
run: sudo chown -R rosbuild:rosbuild "$HOME" .
45+
# Needed to access the vcs repos file from the workspace
46+
# This allows the workflow to test the release-latest branch
47+
- name: Checkout source
48+
uses: actions/checkout@v2
49+
# master workflow: scheduled and PRs with the correct args
50+
- name: Build and test ${{ matrix.ros_distro }} ${{ matrix.ros_version }} ${{ matrix.build_type }}
51+
uses: ros-tooling/[email protected]
52+
if: ${{ matrix.build_type == 'master' }}
4653
with:
4754
source-ros-binary-installation: ${{ matrix.ros_distro }}
4855
package-name: aws_common
4956
extra-cmake-args: ${{ matrix.extra_cmake_args }}
50-
vcs-repo-file-url: ''
51-
- uses: actions/upload-artifact@v1
57+
vcs-repo-file-url: ""
58+
# release-latest workflow: scheduled only with the correct args
59+
- name: Build and test ${{ matrix.ros_distro }} ${{ matrix.ros_version }} ${{ matrix.build_type }}
60+
uses: ros-tooling/[email protected]
61+
if: ${{ matrix.build_type == 'release-latest' && github.event_name == 'schedule' }}
62+
with:
63+
source-ros-binary-installation: ${{ matrix.ros_distro }}
64+
package-name: aws_common
65+
extra-cmake-args: ${{ matrix.extra_cmake_args }}
66+
vcs-repo-file-url: "${{ github.workspace }}/.github/workflows/release-latest.repos"
67+
- name: Upload workflow colcon logs as artifacts
68+
uses: actions/upload-artifact@v1
69+
# Don't upload if release-latest didn't run (no artifacts to upload)
70+
if: ${{ matrix.build_type == 'master' || github.event_name == 'schedule' }}
5271
with:
5372
name: colcon-logs-${{ matrix.ubuntu_distro }}-ros-${{ matrix.ros_distro }}
5473
path: ros_ws/log
@@ -58,7 +77,7 @@ jobs:
5877
container:
5978
image: ubuntu:bionic
6079
needs:
61-
- build_and_test_master
80+
- build_and_test
6281
# Don't skip if prior steps failed, but don't run on a fork because it won't have access to AWS secrets
6382
if: ${{ always() && ! github.event.repository.fork && ! github.event.pull_request.head.repo.fork }}
6483
steps:
@@ -70,6 +89,12 @@ jobs:
7089
aws-region: ${{ secrets.AWS_REGION }}
7190
- uses: ros-tooling/[email protected]
7291
with:
92+
metric-dimensions: >-
93+
[
94+
{ "Name": "github.event_name", "Value": "${{ github.event_name }}" },
95+
{ "Name": "github.ref", "Value": "build_and_test" },
96+
{ "Name": "github.repository", "Value": "${{ github.repository }}" }
97+
]
7398
# Checks if any of the jobs have failed.
7499
#
75100
# needs.*.result is returns the list of all success statuses as an

.github/workflows/build_and_test_release_latest.yml

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)