Skip to content

Test with Autoware #1113

Test with Autoware

Test with Autoware #1113

name: Test with Autoware
# cspell:ignore localtime
on:
schedule:
- cron: 0 16 * * * # run at 1 AM JST
# pull_request:
workflow_dispatch:
env:
IMAGE: tier4/caret_report
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
# - ros_version: galactic
# dockerfile: Dockerfile_galactic.dockerfile
# do_test: false
- ros_version: humble
dockerfile: Dockerfile
do_test: true
steps:
- name: Check out repository
uses: actions/[email protected]
- name: Create tag
run: |
SHA=${{ github.sha }}
TAG=${IMAGE}_${{ matrix.ros_version }}:$(TZ=UTC-9 date '+%Y%m%d_%H%M%S')-${SHA:0:7}
echo "TAGS=$TAG" >> $GITHUB_ENV
echo TAG $TAG
- name: Docker Build
run: |
docker pull osrf/ros:${{ matrix.ros_version }}-desktop
docker image build --no-cache=true -t ${{ env.TAGS }} -f ./docker/${{ matrix.dockerfile }} ./docker
- name: Get package list
if: ${{ matrix.do_test }}
run: |
docker run --rm \
--user $(id -u):$(id -g) \
-v `pwd`:/work \
${{ env.TAGS }} \
bash -c "dpkg -l > /work/package_list.txt; pip3 list > /work/pip_list.txt"
- name: Upload package list
if: ${{ matrix.do_test }}
uses: actions/upload-artifact@v3
with:
name: package_list
path: |
package_list.txt
pip_list.txt
- name: Get reference trace data
if: ${{ matrix.do_test }}
run: |
wget -nv https://github.com/tier4/CARET_report/releases/download/20231114/session-20231114050140.tgz
tar xzvf session-20231114050140.tgz
- name: Create CARET report
if: ${{ matrix.do_test }}
run: |
script_path=`pwd`
trace_data=`pwd`/session-20231114050140
work_dir=`pwd`/sample_autoware
report_store_dir="${work_dir}"
export trace_data_name=`basename ${trace_data}`
export start_strip=0
export end_strip=0
export sim_time=false
export component_list_json=component_list.json
export target_path_json=target_path.json
export max_node_depth=20
export timeout=120
export draw_all_message_flow=false
export relpath_from_report_store_dir=false
docker run --rm \
--user $(id -u):$(id -g) \
-v /etc/localtime:/etc/localtime:ro \
-v ${script_path}:/CARET_report \
-v ${trace_data}:/${trace_data_name} \
-v ${work_dir}:/work \
-v ${report_store_dir}:/report_store_dir \
-e trace_data_name \
-e start_strip \
-e end_strip \
-e sim_time \
-e component_list_json \
-e target_path_json \
-e max_node_depth \
-e timeout \
-e draw_all_message_flow \
-e relpath_from_report_store_dir \
${{ env.TAGS }}
- name: Upload report
if: ${{ matrix.do_test }}
uses: actions/upload-artifact@v3
with:
name: report_session-20231114050140
path: ./sample_autoware/output/report_session-20231114050140
- name: Compare report contents
if: ${{ matrix.do_test }}
run: |
sudo apt-get install -y imagemagick
wget -v https://github.com/tier4/CARET_report/releases/download/20231114/report_session-20231114050140.zip
unzip report_session-20231114050140.zip
mv report_session-20231114050140 reference_result
export report_dir_1=`pwd`/reference_result
export report_dir_2=`pwd`/sample_autoware/output/report_session-20231114050140
sh `pwd`/compare/compare.sh