-
Notifications
You must be signed in to change notification settings - Fork 43
82 lines (76 loc) · 2.37 KB
/
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
name: tests
on:
# Run action on certain pull request events
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
# Nightly job on default (main) branch
schedule:
- cron: '0 0 * * *'
# Ensures that only one workflow runs at a time for this branch
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
# Pure Python testing
python-test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install -e pyrobosim
pip3 install -r test/python_test_requirements.txt
setup/setup_pddlstream.bash
- name: Run unit tests
run: |
export PYTHONPATH=./dependencies/pddlstream:$PYTHONPATH
test/run_tests.bash
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: test/results/
# Always publish test results even when there are failures.
if: ${{ always() }}
# Build and test with ROS 2
ros2-test:
strategy:
matrix:
ros_distro: [humble, iron, rolling]
name: ros-${{ matrix.ros_distro }}-test
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker
- name: Build Docker image
uses: docker/build-push-action@v5
with:
file: docker/Dockerfile
context: .
build-args: |
ROS_DISTRO=${{ matrix.ros_distro }}
tags: pyrobosim:${{ matrix.ros_distro }}
- name: Run tests
run: |
docker run \
--volume ./test/:/pyrobosim_ws/test/:rw \
--volume ./pytest.ini:/pyrobosim_ws/pytest.ini:rw \
pyrobosim:${{ matrix.ros_distro }} \
/bin/bash -c './test/run_tests.bash'
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.ros_distro }}
path: test/results/
# Always publish test results even when there are failures.
if: ${{ always() }}