This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
73 lines (72 loc) · 2.77 KB
/
build_and_test.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
name: Build & Test
on:
pull_request:
push:
branches:
- master
schedule:
# Run every hour. This helps detect flakiness,
# and broken external dependencies.
- cron: '0 * * * *'
jobs:
build_and_test_master:
name: Build and Test Master ROS ${{ matrix.ros_version }} ${{ matrix.ros_distro }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ros_distro: [kinetic, melodic]
include:
- ros_distro: kinetic
ubuntu_distro: xenial
extra_cmake_args: --cmake-target tests
- ros_distro: melodic
ubuntu_distro: bionic
extra_cmake_args: --cmake-target tests
container:
image: rostooling/setup-ros-docker:ubuntu-${{ matrix.ubuntu_distro }}-ros-${{ matrix.ros_distro }}-ros-base-latest
env:
# Needed for the CMakeLists.txt setup
ROS_DISTRO: ${{ matrix.ros_distro }}
ROS_VERSION: 1
steps:
# Needed to access the vcs repos file from the workspace
- name: Checkout source
uses: actions/checkout@v2
- name: Run action-ros-ci to build and test
uses: ros-tooling/[email protected]
with:
target-ros1-distro: ${{ env.ROS_VERSION == '1' && matrix.ros_distro || '' }}
target-ros2-distro: ${{ env.ROS_VERSION == '2' && matrix.ros_distro || '' }}
package-name: aws_ros1_common
extra-cmake-args: ${{ matrix.extra_cmake_args }}
vcs-repo-file-url: ''
- name: Upload resulting colcon logs
uses: actions/[email protected]
with:
name: colcon-logs-${{ matrix.ubuntu_distro }}-ros-${{ matrix.ros_distro }}
path: ros_ws/log
log_workflow_status_to_cloudwatch:
runs-on: ubuntu-latest
container:
image: ubuntu:bionic
needs:
- build_and_test_master
# Don't skip if prior steps failed, but don't run on a fork because it won't have access to AWS secrets
if: ${{ always() && ! github.event.repository.fork && ! github.event.pull_request.head.repo.fork }}
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- uses: ros-tooling/[email protected]
with:
# Checks if any of the jobs have failed.
#
# needs.*.result is returns the list of all success statuses as an
# array, i.e. ['success', 'failure, 'success']
# join() converts the array to a string 'successfailuresuccess'
# contains() checks whether the string contains failure
metric-value: ${{ ! contains(join(needs.*.result, ''), 'failure') && ! contains(join(needs.*.result, ''), 'cancelled') }}