forked from viamrobotics/rdk
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (65 loc) · 2.46 KB
/
motion-benchmarks.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
name: Motion Benchmarks
on:
workflow_dispatch:
workflow_call:
jobs:
motion_benchmarks:
name: Motion Benchmarks
runs-on: ubuntu-large
container: ghcr.io/viamrobotics/rdk-devenv:amd64-cache
timeout-minutes: 30
env:
BASELINE: ${{ github.event.pull_request.base.label }}
MODIFIED: ${{ github.event.pull_request.head.label }}
steps:
- name: Check out main branch code
if: github.event_name != 'pull_request_target'
uses: actions/checkout@v3
- name: Check out PR branch code
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Check out code in motion-testing repository
uses: actions/checkout@v3
with:
repository: viamrobotics/motion-testing
path: motion-testing
- name: Change ownership to testbot
run: chown -R testbot:testbot .
- name: Run motion quality tests on main branch
shell: bash
env:
URL: ${{ github.event.pull_request.base.repo.html_url }}
SHA: ${{ github.event.pull_request.base.sha }}
run: |
cd motion-testing
go mod edit -replace go.viam.com/rdk=${URL#"https://"}@$SHA
sudo -Hu testbot bash -lc "go mod tidy && go test ./... -v -run TestDefault --name=$BASELINE"
- name: Run motion quality tests on PR branch
shell: bash
env:
URL: ${{ github.event.pull_request.head.repo.html_url }}
SHA: ${{ github.event.pull_request.head.sha }}
run: |
cd motion-testing
go mod edit -replace go.viam.com/rdk=${URL#"https://"}@$SHA
sudo -Hu testbot bash -lc "go mod tidy && go test ./... -v -run TestDefault --name=$MODIFIED"
- name: Print results
run: |
cd motion-testing
sudo -Hu testbot bash -lc "go test ./... -v -run TestScores --baselineDir=$BASELINE --modifiedDir=$MODIFIED"
cat results/motion-benchmarks.md
# Now that RDK is public, can't directly comment without token having full read/write access
# motion-benchmarks-comment.yml will trigger seperately and post the actual comments
- name: Prepare code comment
run: |
echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> pr.env
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: pr-motion-benchmark
path: |
pr.env
motion-testing/results/motion-benchmarks.md
retention-days: 1