-
Notifications
You must be signed in to change notification settings - Fork 48
132 lines (128 loc) · 6.06 KB
/
ros2.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
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
name: build-and-bundle
on:
pull_request:
push:
branches:
- ros2
schedule:
- cron: '0 */2 * * *' # runs every 2 hrs on a daily basis
jobs:
build_and_bundle_ros2:
strategy:
matrix:
distro: ['foxy']
gazebo: [11]
include:
- distro: foxy
gazebo: 11
ubuntu_distro: focal
runs-on: ubuntu-latest
if: ${{ github.event_name == 'schedule' || github.ref == 'refs/heads/ros2' }}
name: 'Build and Bundle (ROS2)'
container:
image: ubuntu:${{ matrix.ubuntu_distro }}
outputs:
robot_ws_build_result: ${{ steps.robot_ws_build.outcome }}
simulation_ws_build_result: ${{ steps.simulation_ws_build.outcome }}
steps:
- name: Checkout Branch
uses: actions/checkout@v1
with:
ref: 'ros2'
- name: Scan using git-secrets
uses: aws-robotics/aws-robomaker-github-actions/[email protected]
- id: robot_ws_build
name: Build and Bundle Robot Workspace
uses: aws-robotics/aws-robomaker-github-actions/[email protected]
with:
ros-distro: ${{ matrix.distro }}
workspace-dir: robot_ws
generate-sources: true
retries: 3
- id: simulation_ws_build
name: Build and Bundle Simulation Workspace
uses: aws-robotics/aws-robomaker-github-actions/[email protected]
with:
ros-distro: ${{ matrix.distro }}
workspace-dir: simulation_ws
retries: 3
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_ROS2 }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_ROS2 }}
aws-region: ${{ secrets.AWS_REGION }}
if: ${{ github.event_name == 'schedule' && contains(steps.robot_ws_build.outcome, 'success') && contains(steps.simulation_ws_build.outcome, 'success') }}
- id: upload_bundle
name: Upload bundle to S3
uses: aws-robotics/aws-robomaker-github-actions/[email protected]
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET_ROS2 }}
AWS_REGION: ${{ secrets.AWS_REGION }}
FILES: 'sources.zip sources.tar.gz robot_ws.tar simulation_ws.tar'
DEST: 'travis/hello-world/${{ matrix.distro }}/gazebo${{ matrix.gazebo }}/${{ steps.robot_ws_build.outputs.sample-app-version }}.${{ github.run_number }}/'
if: ${{ github.event_name == 'schedule' && contains(steps.robot_ws_build.outcome, 'success') && contains(steps.simulation_ws_build.outcome, 'success') }} # upload to S3 on "schedule" build if the build was successful
- name: Get time stamp
id: time
run: echo "::set-output name=timestamp::$(date +%s)"
if: ${{ github.event_name == 'schedule' && contains(steps.robot_ws_build.outcome, 'success') && contains(steps.simulation_ws_build.outcome, 'success') }}
- name: Update App-manifest version number
id: update-app-manifest
uses: aws-robotics/aws-robomaker-github-actions/[email protected]
env:
AWS_CODECOMMIT_REPO_NAME: '${{ secrets.AWS_CODECOMMIT_REPO_NAME_PREFIX_HELLO_WORLD }}-${{ matrix.distro }}-gazebo${{ matrix.gazebo }}'
AWS_CODECOMMIT_BRANCH_NAME: ${{ secrets.AWS_CODECOMMIT_BRANCH_NAME_HELLO_WORLD }}
DEST_FILE_CONTENT: '{"application_version": "${{ steps.robot_ws_build.outputs.sample-app-version }}.${{ github.run_number }}", "timestamp":"${{ steps.time.outputs.timestamp }}"}'
DEST_FILE_PATH: '/version.json'
COMMIT_MSG: 'Updating to version ${{ steps.robot_ws_build.outputs.sample-app-version }}.${{ github.run_number }}. Commit for this version bump: ${{ github.sha }}.'
USER_EMAIL: '[email protected]'
USER_NAME: 'ros-contributions'
if: ${{ github.event_name == 'schedule' && contains(steps.robot_ws_build.outcome, 'success') && contains(steps.simulation_ws_build.outcome, 'success') }} # Update app-manifest version number if the build was successful
log_workflow_status_to_cloudwatch:
runs-on: ubuntu-latest
container:
image: ubuntu:focal
needs:
- build_and_bundle_ros2
if: ${{ always() && github.event_name != 'pull_request' }}
steps:
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_ROS2 }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_ROS2 }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Log Robot Workspace Build Status
uses: ros-tooling/[email protected]
with:
metric-dimensions: >-
[
{ "Name": "github.event_name", "Value": "${{ github.event_name }}" },
{ "Name": "github.ref", "Value": "refs/heads/ros2" },
{ "Name": "github.repository", "Value": "${{ github.repository }}" }
]
namespace: RobotWorkspaceBuild
metric-value: ${{ contains(needs.build_and_bundle_ros2.outputs.robot_ws_build_result, 'success') }}
- name: Log Simulation Workspace Build Status
uses: ros-tooling/[email protected]
with:
metric-dimensions: >-
[
{ "Name": "github.event_name", "Value": "${{ github.event_name }}" },
{ "Name": "github.ref", "Value": "refs/heads/ros2" },
{ "Name": "github.repository", "Value": "${{ github.repository }}" }
]
namespace: SimulationWorkspaceBuild
metric-value: ${{ contains(needs.build_and_bundle_ros2.outputs.simulation_ws_build_result, 'success') }}
- name: Log Bundle Upload Status
uses: ros-tooling/[email protected]
with:
metric-dimensions: >-
[
{ "Name": "github.event_name", "Value": "${{ github.event_name }}" },
{ "Name": "github.ref", "Value": "refs/heads/ros2" },
{ "Name": "github.repository", "Value": "${{ github.repository }}" }
]
namespace: BundleUpload
metric-value: ${{ contains(needs.build_and_bundle_ros2.result, 'success') }}
if: ${{ github.event_name == 'schedule' }}