-
Notifications
You must be signed in to change notification settings - Fork 7
161 lines (144 loc) · 5.01 KB
/
ci-tests.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Build, Test, and Benchmark
on:
push:
branches:
- master
- develop
- pipeline-test
- modified_dubins
pull_request:
types: [opened, reopened]
branches:
- master
- develop
jobs:
build-and-test:
runs-on: ubuntu-latest
container:
image: bradygm/trochoids-test
if: "always() && !contains(github.event.head_commit.message, 'DO-NOT-RUN')"
steps:
- name: 'Preparing workspace'
uses: actions/checkout@v3
with:
path: ws/src/
- name: build workspace
run: |
cd ws/
catkin config --extend /opt/ros/$ROS_DISTRO
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
catkin build
catkin build --make-args tests -- trochoids
# Run benchmark with `go test -bench` and stores the output to a file
# --benchmark_repetitions=12 --benchmark_min_time=0.042
- name: Run benchmark
shell: bash
run: |
source /opt/ros/noetic/setup.bash
source ws/devel/setup.bash
./ws/devel/lib/trochoids/trochoids-benchmark --benchmark_format=json | tee benchmark_result.json
git config --global user.name "Github Action"
git config --global user.email "[email protected]"
# Download previous benchmark result from cache (if exists)
- name: Download previous benchmark data
uses: actions/cache@v3
with:
path: ./cache
key: ${{ runner.os }}-benchmark
# Run `github-action-benchmark` action
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
# What benchmark tool the output.txt came from
tool: 'googlecpp'
# Where the output from the benchmark tool is stored
output-file-path: benchmark_result.json
# Where the previous data file is stored
external-data-json-path: ./cache/benchmark-data.json
# Workflow will fail when an alert happens
fail-on-alert: false
# GitHub API token to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
# Enable alert commit comment
comment-on-alert: true
# Mention @rhysd in the commit comment
alert-comment-cc-users: '@bradygm'
alert-threshold: 150%
comment-always: true
# Upload the updated cache file for the next job by actions/cache
- name: Run unit tests
shell: bash
run: |
source /opt/ros/noetic/setup.bash
source ws/devel/setup.bash
./ws/devel/lib/trochoids/trochoids-test
# name: Save results to gh-pages
# on:
# push:
# branches:
# - master
# # workflow_run:
# # workflows: ["Build, Test, and Benchmark"]
# # types:
# # - completed
# # branches:
# # - master
# jobs:
# benchmark-and-publish:
# runs-on: ubuntu-latest
# container:
# image: bradygm/trochoids-test
# if: "always() && !contains(github.event.head_commit.message, 'DO-NOT-RUN')"
# steps:
# - name: 'Preparing workspace'
# uses: actions/checkout@v3
# with:
# path: ws/src/
# - name: build workspace
# run: |
# cd ws/
# catkin config --extend /opt/ros/$ROS_DISTRO
# catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
# catkin build
# # Run benchmark with `go test -bench` and stores the output to a file
# # --benchmark_repetitions=12 --benchmark_min_time=0.042
# - name: Run benchmark
# shell: bash
# run: |
# source /opt/ros/noetic/setup.bash
# source ws/devel/setup.bash
# roscore &
# sleep 3
# ./ws/devel/lib/trochoids/trochoids-benchmark --benchmark_format=json | tee benchmark_result.json
# pkill rosmaster
# git config --global user.name "Github Action"
# git config --global user.email "[email protected]"
# echo "$(pwd)"
# echo "$(ls)"
# # Download previous benchmark result from cache (if exists)
# - name: Download previous benchmark data
# uses: actions/cache@v3
# with:
# path: ./cache
# key: ${{ runner.os }}-benchmark
# - name: Preparing gh-pages workspace
# uses: actions/checkout@v3
# # Run `github-action-benchmark` action
# - name: Store benchmark result
# uses: benchmark-action/github-action-benchmark@v1
# with:
# # What benchmark tool the output.txt came from
# tool: 'googlecpp'
# # Where the output from the benchmark tool is stored
# output-file-path: /__w/trochoids/trochoids/benchmark_result.json
# # Workflow will fail when an alert happens
# fail-on-alert: false
# # GitHub API token to make a commit comment
# github-token: ${{ secrets.GITHUB_TOKEN }}
# # Enable alert commit comment
# comment-on-alert: false
# # Mention @rhysd in the commit comment
# alert-comment-cc-users: '@bradygm'
# alert-threshold: 200%
# auto-push: true
# # Upload the updated cache file for the next job by actions/cache