-
Notifications
You must be signed in to change notification settings - Fork 48
110 lines (108 loc) · 5.2 KB
/
ros1.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
name: build-and-bundle
on:
pull_request:
push:
branches:
- ros1
schedule:
- cron: '0 */2 * * *' # runs every 2 hrs on a daily basis
jobs:
build_and_bundle_ros1:
strategy:
matrix:
distro: ['melodic']
gazebo: [9]
include:
- distro: melodic
gazebo: 9
ubuntu_distro: bionic
runs-on: ubuntu-latest
if: ${{ github.event_name != 'push' || github.ref != 'refs/heads/ros2' }}
name: 'Build and Bundle (ROS1)'
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
- 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: 5
- 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: 5
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_ROS1 }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_ROS1 }}
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_ROS1 }}
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:bionic
needs:
- build_and_bundle_ros1
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_ROS1 }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_ROS1 }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Log Robot Workspace Build Status
uses: ros-tooling/[email protected]
with:
namespace: RobotWorkspaceBuild
metric-value: ${{ contains(needs.build_and_bundle_ros1.outputs.robot_ws_build_result, 'success') }}
- name: Log Simulation Workspace Build Status
uses: ros-tooling/[email protected]
with:
namespace: SimulationWorkspaceBuild
metric-value: ${{ contains(needs.build_and_bundle_ros1.outputs.simulation_ws_build_result, 'success') }}
- name: Log Bundle Upload Status
uses: ros-tooling/[email protected]
with:
namespace: BundleUpload
metric-value: ${{ contains(needs.build_and_bundle_ros1.result, 'success') }}
if: ${{ github.event_name == 'schedule' }}