-
Notifications
You must be signed in to change notification settings - Fork 21
73 lines (71 loc) · 2.01 KB
/
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: test
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
jobs:
test:
runs-on: ubuntu-22.04
container: osrf/ros:humble-desktop-full
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- name: apt update install
run: |
sudo apt update -y
sudo apt install -y \
psmisc \
rsync \
xvfb \
ros-$ROS_DISTRO-navigation2 \
ros-$ROS_DISTRO-nav2-bringup \
ros-$ROS_DISTRO-turtlebot3-gazebo
- name: build
run: |
mkdir -p /root/ros2_ws/src/emcl2_ros2/
rsync -av ./ /root/ros2_ws/src/emcl2_ros2/
cd /root/ros2_ws
source /opt/ros/$ROS_DISTRO/setup.bash
rosdep update
rosdep install -i -y --from-path src --rosdistro $ROS_DISTRO
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
shell: bash
- name: exec
run: |
source /root/ros2_ws/install/setup.bash
ros2 run emcl2 test.bash
shell: bash
- name: set completion flag
id: complete
run: echo "job_complete=true" >> $GITHUB_ENV
retry:
runs-on: ubuntu-latest
needs: test
if: ${{ always() && needs.build.result == 'failure' }}
steps:
- name: Check if timeout
id: check
run: |
if [[ "${{ needs.build.outputs.job_complete }}" != 'true' ]]; then
echo "::set-output name=timeout::true"
fi
- name: Retry Workflow
if: steps.check.outputs.timeout == 'true'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { owner, repo } = context.repo;
await github.actions.createWorkflowDispatch({
owner,
repo,
workflow_id: '${{ github.workflow_id }}',
ref: '${{ github.ref }}',
});