forked from viamrobotics/rdk
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (57 loc) · 2.11 KB
/
motion-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
name: Motion Extended Tests
on:
workflow_dispatch:
workflow_call:
jobs:
check-files:
name: Check files
runs-on: ubuntu-latest
outputs:
EXTENDED_MOTION_TEST: ${{ steps.file_checker.outputs.EXTENDED_MOTION_TEST }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}
fetch-depth: 0
- name: check modified files
id: file_checker
run: |
( git diff --name-only origin/${{github.base_ref}}... | grep -e "motionplan" \
-e "referenceframe" \
-e "spatialmath" \
-e "components/base/wheeled" \
-e "components/base/kinematicbase" \
-e "components/encoder/fake" \
-e "components/motor/fake" \
-e "services/motion/builtin" && echo "EXTENDED_MOTION_TEST=true" >> "$GITHUB_OUTPUT" ) || \
( echo "EXTENDED_MOTION_TEST=false" >> "$GITHUB_OUTPUT" )
motion-tests-extended:
name: Motion Extended Tests
needs: check-files
runs-on: ubuntu-large
container: ghcr.io/viamrobotics/rdk-devenv:amd64-cache
if: ${{ needs.check-files.outputs.EXTENDED_MOTION_TEST == 'true' }}
timeout-minutes: 30
steps:
- 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 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 TestMotionExtended"