Skip to content

scenario-test

scenario-test #7

name: scenario-test
on:
workflow_dispatch:
jobs:
scenario-test:
runs-on: ubuntu-24.04
container:
image: ghcr.io/autowarefoundation/autoware:universe-devel
env:
RMW_IMPLEMENTATION: rmw_cyclonedds_cpp
options: --network=host
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Show disk space before the tasks
run: df -h
- name: Show machine specs
run: lscpu && free -h
- name: Install required packages
run: |
apt-get update
apt-get install -y \
unzip \
curl \
gnupg2 \
lsb-release \
python3-pip \
git \
libxml2-utils
pip install --upgrade gdown vcstool
shell: bash
- name: Clone Autoware and Import simulator.repos
run: |
cd ~
git clone https://github.com/autowarefoundation/autoware.git autoware_ws
cd ~/autoware_ws
mkdir src
vcs import src < simulator.repos
shell: bash
- name: Install ROS dependencies
run: |
source /opt/ros/humble/setup.bash
source /opt/autoware/setup.bash
cd ~/autoware_ws
rosdep update
rosdep install --from-paths src --ignore-src -r -y
shell: bash
- name: Downgrade xmlschema
run: |
pip3 install --user xmlschema==3.4.5
shell: bash
- name: Build Autoware
run: |
cd ~/autoware_ws
source /opt/ros/humble/setup.bash
source /opt/autoware/setup.bash
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
source install/setup.bash
shell: bash
- name: Download scenario file
run: |
gdown --id 1Tq7snfDPsuPHPtl50aL5fJY6paiC-HxV -O sample-scenario.yaml
if [ -f "sample-scenario.yaml" ]; then
echo "sample-scenario.yaml downloaded successfully"
else
echo "ERROR: sample-scenario.yaml is missing!"
exit 1
fi
shell: bash
- name: Download sample-map-planning maps
# cspell:disable
run: |
gdown --id 1499_nsbUbIeturZaDj7jhUownh5fvXHd -O sample-map-planning.zip
unzip sample-map-planning.zip -d /autoware_map
# cspell:enable
shell: bash
- name: Fix path in sample-scenario.yaml
run: |
sed -i "s@/home/user/autoware_map/sample-map-planning/@/autoware_map/sample-map-planning/@g" sample-scenario.yaml
shell: bash
- name: Launch scenario_test_runner with diagnostics
run: |
SCENARIO_FILE="./sample-scenario.yaml"
source ~/autoware_ws/install/setup.bash
echo "Launching scenario_test_runner..."
mkdir -p ./results
ros2 launch scenario_test_runner scenario_test_runner.launch.py \
architecture_type:=awf/universe/20250130 \
record:=true \
scenario:="$SCENARIO_FILE" \
sensor_model:=sample_sensor_kit \
vehicle_model:=sample_vehicle \
initialize_duration:=100 \
output_directory:=./results
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: scenario-test-results
path: ./results
- name: Parse results and capture diagnostics
run: |
XML_FILE="./results/scenario_test_runner/result.junit.xml"
if [ ! -f $XML_FILE ]; then
echo "ERROR: test_results.log is missing! The simulation might have crashed."
exit 1
fi
failures=$(xmllint --xpath 'string(/testsuites/@failures)' "$XML_FILE")
errors=$(xmllint --xpath 'string(/testsuites/@errors)' "$XML_FILE")
if [ "$failures" -gt 0 ] || [ "$errors" -gt 0 ]; then
echo "ERROR: Detected failures or errors in the simulation."
exit 1
fi
shell: bash