Skip to content

Commit 8809331

Browse files
authored
Add tests to Sample App CI GitHub action for ROS2 (#14)
* Update test.yml * Update test.yml * Move ros2 related tests to its own file * Update test-ros2.yml
1 parent c25076f commit 8809331

File tree

2 files changed

+104
-2
lines changed

2 files changed

+104
-2
lines changed

.github/workflows/test-ros2.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: "Test aws-robomaker-github-actions-ros-2"
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- master
8+
- 'releases/*'
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
jobs:
15+
test_robomaker-sample-app-ci-ros2:
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
matrix:
20+
distro: ['dashing']
21+
gazebo: [9]
22+
include:
23+
- distro: dashing
24+
gazebo: 9
25+
ubuntu_distro: bionic
26+
container:
27+
image: rostooling/setup-ros-docker:ubuntu-${{ matrix.ubuntu_distro }}-ros-${{ matrix.distro }}-ros-base-latest
28+
29+
# NOTES: We run 2 tests for robot_ws and simulation_ws
30+
# The test steps are duplicated because github workflow does not support reusable step (with parameter yet)
31+
# We also can use matrix to run tests with different parameters but it is overkill for this
32+
steps:
33+
- name: Setup permissions
34+
run: |
35+
# Due to user permisson issue, calling chown is necessary for now
36+
# Related issue: https://github.com/actions/checkout/issues/47
37+
# Note: rosbuild is the user of the docker image
38+
# TODO(ros-tooling/setup-ros-docker#7):
39+
sudo chown -R rosbuild:rosbuild "$HOME" .
40+
# Checkout SA ros1 branch into default root folder
41+
- name: Checkout hello world sample app
42+
uses: actions/checkout@v2
43+
with:
44+
repository: aws-robotics/aws-robomaker-sample-application-helloworld
45+
ref: ros2
46+
# Checkout action code into action folder
47+
- name: Checkout action code
48+
uses: actions/checkout@v2
49+
with:
50+
path: action
51+
- name: Setup nodeJS
52+
uses: actions/setup-node@v1
53+
with:
54+
node-version: '12.x'
55+
- name: Install nodeJS packages
56+
run: npm install
57+
working-directory: ./action/robomaker-sample-app-ci
58+
- name: Build test script
59+
run: npm run build
60+
working-directory: ./action/robomaker-sample-app-ci
61+
62+
# Trigger to run robomaker-sample-app-ci action script
63+
- name: Build and bundle robot_ws
64+
uses: ./action/robomaker-sample-app-ci
65+
with:
66+
ros-distro: ${{ matrix.distro }}
67+
gazebo-version: ${{ matrix.gazebo }}
68+
workspace-dir: ./robot_ws
69+
generate-sources: true
70+
# Expectation: bundle file, build files, and dependencies all exist
71+
- name: Check robot_ws file existence
72+
id: check_robot_ws_files
73+
uses: andstor/file-existence-action@87d74d4
74+
with:
75+
files: "./robot_ws.tar, ./robot_ws/build, ./robot_ws/install, ./robot_ws/src/deps"
76+
allow_failure: true
77+
78+
# Trigger to run robomaker-sample-app-ci action script
79+
- name: Build and bundle simulation_ws
80+
uses: ./action/robomaker-sample-app-ci
81+
with:
82+
ros-distro: ${{ matrix.distro }}
83+
gazebo-version: ${{ matrix.gazebo }}
84+
workspace-dir: ./simulation_ws
85+
generate-sources: false
86+
# Expectation: bundle file, build files, and dependencies all exist
87+
- name: Check simulation_ws file existence
88+
id: check_simulation_ws_files
89+
uses: andstor/file-existence-action@87d74d4
90+
with:
91+
files: "./simulation_ws.tar, ./simulation_ws/build, ./simulation_ws/install, ./simulation_ws/src/deps"
92+
allow_failure: true
93+
94+
# Expectation: source files exist
95+
- name: Check source file existence
96+
id: check_source_files
97+
uses: andstor/file-existence-action@87d74d4
98+
with:
99+
files: "./sources.zip, ./sources.tar.gz"
100+
101+
- name: Check all files exists
102+
if: steps.check_robot_ws_files.outputs.files_exists == 'true' && steps.check_simulation_ws_files.outputs.files_exists == 'true' && steps.check_source_files.outputs.files_exists == 'true'
103+
# Only runs if all of the files exists
104+
run: echo All files exists!

.github/workflows/test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,3 @@ jobs:
112112
if: steps.check_robot_ws_files.outputs.files_exists == 'true' && steps.check_simulation_ws_files.outputs.files_exists == 'true' && steps.check_source_files.outputs.files_exists == 'true'
113113
# Only runs if all of the files exists
114114
run: echo All files exists!
115-
116-

0 commit comments

Comments
 (0)