-
Notifications
You must be signed in to change notification settings - Fork 4
99 lines (84 loc) · 2.55 KB
/
build-and-test.yaml
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
name: build-and-test
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
# Upload and download actions are used since
# gh command is't available in the docker container and
# it's hard to setup it in the container.
download-test-data:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download test data
run: |
gh release download test-data -D tests/data
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload data for build-and-test
uses: actions/upload-artifact@v3
with:
name: test-data
path: tests/data
build-and-test:
runs-on: ubuntu-latest
timeout-minutes: 20
container:
image: ros:${{ matrix.rosdistro }}
strategy:
matrix:
rosdistro:
- humble
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: |
apt update -yqq
apt install -yqq curl python3-venv python-is-python3 \
libgl1-mesa-dev libboost-dev ros-${ROS_DISTRO}-sensor-msgs-py ros-${ROS_DISTRO}-rosbag2-storage-mcap \
ros-${ROS_DISTRO}-radar-msgs unzip tree
- name: Download test data
uses: actions/download-artifact@v3
with:
name: test-data
path: tests/data
- name: Unzip test data
run: |
unzip 'tests/data/*.zip' -d tests/data/
- name: Check test data
run: |
tree tests/data
- name: Build autoware perception messages
uses: autowarefoundation/autoware-github-actions/colcon-build@v1
with:
rosdistro: ${{ matrix.rosdistro }}
target-packages: autoware_auto_perception_msgs autoware_perception_msgs tier4_perception_msgs oxts_msgs vehicle_msgs
build-depends-repos: build_depends.repos
- name: Check python version
run: |
python -V
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 - --version 1.4.2
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Check poetry version
run: |
poetry --version
- name: Install python packages
run: |
poetry install
- name: Test with pytest
run: |
. /opt/ros/$ROS_DISTRO/setup.sh
. ./install/setup.sh
poetry run pytest -v