Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(build-and-test-differential): modify clang-tidy to run only on specified packages #9016

Closed
Closed
22 changes: 15 additions & 7 deletions .github/workflows/build-and-test-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,28 @@ jobs:
id: get-modified-packages
uses: autowarefoundation/autoware-github-actions/get-modified-packages@v1

- name: Get changed files (existing files only)
id: get-changed-files
- name: Get required packages
id: get-required-packages
uses: mikefarah/yq@master
with:
cmd: yq '.[]' clang-tidy-required-packages.yaml

- name: Get target packages
id: get-target-packages
run: |
echo "changed-files=$(git diff --name-only "origin/${{ github.base_ref }}"...HEAD | grep -E '\.(cpp|hpp)$' | while read -r file; do [ -e "$file" ] && echo -n "$file "; done)" >> $GITHUB_OUTPUT
echo "${{ steps.get-required-packages.outputs.result }}" > required_packages.txt
echo "${{ steps.get-modified-packages.outputs.modified-packages }}" | tr ' ' '\n' > modified_packages.txt
PACKAGES=$(grep -Fxf required_packages.txt modified_packages.txt | xargs)
echo "target-packages=${PACKAGES}" >> $GITHUB_OUTPUT
shell: bash

- name: Run clang-tidy
if: ${{ steps.get-changed-files.outputs.changed-files != '' }}
uses: autowarefoundation/autoware-github-actions/clang-tidy@v1
if: ${{ steps.get-target-packages.outputs.target-packages != '' }}
uses: yhisaki/autoware-github-actions/clang-tidy@use-ament_clang_tidy
with:
rosdistro: humble
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
target-files: ${{ steps.get-changed-files.outputs.changed-files }}
xmfcx marked this conversation as resolved.
Show resolved Hide resolved
clang-tidy-config-url: https://raw.githubusercontent.com/autowarefoundation/autoware/main/.clang-tidy-ci
target-packages: ${{ steps.get-target-packages.outputs.target-packages }}
build-depends-repos: build_depends.repos
cache-key-element: cuda

Expand Down
223 changes: 223 additions & 0 deletions clang-tidy-required-packages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
##### common #####
SakodaShintaro marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About this file as a whole, what about removing the commented out packages?

This way the file will be cleaner. Right now it is hard to see the "not commented out" packages.

We can just keep adding new packages as they come through.

Copy link
Contributor

@xmfcx xmfcx Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way, the autoware_ prefixing job won't affect it that much.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok thanks, I'll approve once the commented out packages are removed from this file 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yhisaki
Could you update clang-tidy-required-packages.yaml file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yhisaki
I have create a new, minimum .clang-tidy-ci configuration, so please use it and list up the packages which pass the minimum check.
autowarefoundation/autoware#5465

# - autoware_ad_api_specs
# - autoware_auto_common
# - autoware_geography_utils
# - autoware_grid_map_utils
# - autoware_interpolation
# - autoware_kalman_filter
# - autoware_mission_details_overlay_rviz_plugin
# - autoware_motion_utils
# - autoware_overlay_rviz_plugin
# - autoware_path_distance_calculator
# - autoware_perception_rviz_plugin
# - autoware_point_types
# - autoware_signal_processing
# - autoware_test_utils
# - autoware_testing
- autoware_universe_utils
# - autoware_vehicle_info_utils
# - bag_time_manager_rviz_plugin
# - component_interface_specs
# - component_interface_tools
# - component_interface_utils
# - fake_test_node
# - global_parameter_loader
# - glog_component
# - goal_distance_calculator
# - object_recognition_utils
# - osqp_interface
# - polar_grid
# - qp_interface
# - tensorrt_common
# - tier4_adapi_rviz_plugin
# - tier4_api_utils
# - tier4_camera_view_rviz_plugin
# - tier4_datetime_rviz_plugin
# - tier4_localization_rviz_plugin
# - tier4_planning_rviz_plugin
# - tier4_state_rviz_plugin
# - tier4_system_rviz_plugin
# - tier4_traffic_light_rviz_plugin
# - tier4_vehicle_rviz_plugin
# - time_utils
# - traffic_light_recognition_marker_publisher
# - traffic_light_utils
# - tvm_utility
##### control #####
# - autoware_autonomous_emergency_braking
# - autoware_control_validator
# - autoware_external_cmd_selector
# - autoware_joy_controller
# - autoware_lane_departure_checker
# - autoware_mpc_lateral_controller
# - autoware_operation_mode_transition_manager
# - autoware_pid_longitudinal_controller
# - autoware_pure_pursuit
# - autoware_shift_decider
# - autoware_smart_mpc_trajectory_follower
# - autoware_trajectory_follower_base
# - autoware_trajectory_follower_node
# - autoware_vehicle_cmd_gate
# - control_performance_analysis
# - obstacle_collision_checker
# - predicted_path_checker
##### evaluator #####
# - autoware_control_evaluator
# - autoware_evaluator_utils
# - autoware_planning_evaluator
# - diagnostic_converter
# - kinematic_evaluator
# - localization_evaluator
# - perception_online_evaluator
##### map #####
# - autoware_map_height_fitter
# - autoware_map_projection_loader
# - autoware_map_tf_generator
- map_loader
##### perception #####
# - autoware_bytetrack
# - autoware_cluster_merger
# - autoware_compare_map_segmentation
# - autoware_crosswalk_traffic_light_estimator
# - autoware_detected_object_feature_remover
# - autoware_detected_object_validation
# - autoware_detection_by_tracker
# - autoware_elevation_map_loader
# - autoware_euclidean_cluster
# - autoware_ground_segmentation
# - autoware_image_projection_based_fusion
# - autoware_lidar_apollo_instance_segmentation
# - autoware_lidar_centerpoint
# - autoware_lidar_transfusion
# - autoware_map_based_prediction
# - autoware_multi_object_tracker
# - autoware_object_merger
# - autoware_object_range_splitter
# - autoware_object_velocity_splitter
# - autoware_occupancy_grid_map_outlier_filter
# - autoware_probabilistic_occupancy_grid_map
# - autoware_radar_crossing_objects_noise_filter
# - autoware_radar_fusion_to_detected_object
# - autoware_radar_object_clustering
# - autoware_radar_object_tracker
# - autoware_radar_tracks_msgs_converter
# - autoware_raindrop_cluster_filter
# - autoware_shape_estimation
# - autoware_simple_object_merger
# - autoware_tensorrt_classifier
# - autoware_tensorrt_yolox
# - autoware_tracking_object_merger
# - autoware_traffic_light_arbiter
# - autoware_traffic_light_classifier
# - autoware_traffic_light_fine_detector
# - autoware_traffic_light_map_based_detector
# - autoware_traffic_light_multi_camera_fusion
# - autoware_traffic_light_occlusion_predictor
# - autoware_traffic_light_visualization
# - perception_utils
##### planning #####
# - autoware_behavior_path_avoidance_by_lane_change_module
# - autoware_behavior_path_dynamic_obstacle_avoidance_module
# - autoware_behavior_path_external_request_lane_change_module
# - autoware_behavior_path_goal_planner_module
# - autoware_behavior_path_lane_change_module
# - autoware_behavior_path_planner
# - autoware_behavior_path_planner_common
# - autoware_behavior_path_sampling_planner_module
# - autoware_behavior_path_side_shift_module
# - autoware_behavior_path_start_planner_module
# - autoware_behavior_path_static_obstacle_avoidance_module
# - autoware_behavior_velocity_blind_spot_module
# - autoware_behavior_velocity_crosswalk_module
# - autoware_behavior_velocity_detection_area_module
# - autoware_behavior_velocity_intersection_module
# - autoware_behavior_velocity_no_drivable_lane_module
# - autoware_behavior_velocity_no_stopping_area_module
# - autoware_behavior_velocity_occlusion_spot_module
# - autoware_behavior_velocity_planner
# - autoware_behavior_velocity_planner_common
# - autoware_behavior_velocity_run_out_module
# - autoware_behavior_velocity_speed_bump_module
# - autoware_behavior_velocity_stop_line_module
# - autoware_behavior_velocity_template_module
# - autoware_behavior_velocity_traffic_light_module
# - autoware_behavior_velocity_virtual_traffic_light_module
# - autoware_behavior_velocity_walkway_module
# - autoware_bezier_sampler
# - autoware_costmap_generator
# - autoware_external_velocity_limit_selector
# - autoware_freespace_planner
# - autoware_freespace_planning_algorithms
# - autoware_frenet_planner
# - autoware_mission_planner
# - autoware_motion_velocity_dynamic_obstacle_stop_module
# - autoware_motion_velocity_obstacle_velocity_limiter_module
# - autoware_motion_velocity_out_of_lane_module
# - autoware_motion_velocity_planner_common
# - autoware_motion_velocity_planner_node
# - autoware_objects_of_interest_marker_interface
# - autoware_obstacle_cruise_planner
# - autoware_obstacle_stop_planner
# - autoware_path_optimizer
# - autoware_path_sampler
# - autoware_path_smoother
# - autoware_planning_test_manager
# - autoware_planning_topic_converter
# - autoware_planning_validator
# - autoware_remaining_distance_time_calculator
# - autoware_route_handler
# - autoware_rtc_interface
# - autoware_sampler_common
# - autoware_scenario_selector
# - autoware_static_centerline_generator
# - autoware_surround_obstacle_checker
# - autoware_velocity_smoother
##### sensing #####
# - autoware_gnss_poser
# - autoware_image_diagnostics
# - autoware_image_transport_decompressor
# - autoware_imu_corrector
# - autoware_livox_tag_filter
# - autoware_pcl_extensions
# - autoware_pointcloud_preprocessor
# - autoware_radar_scan_to_pointcloud2
# - autoware_radar_static_pointcloud_filter
# - autoware_radar_threshold_filter
# - autoware_radar_tracks_noise_filter
# - cuda_utils
# - vehicle_velocity_converter
##### simulator #####
# - autoware_carla_interface
# - dummy_perception_publisher
# - fault_injection
# - learning_based_vehicle_model
# - simple_planning_simulator
# - tier4_dummy_object_rviz_plugin
# - vehicle_door_simulator
##### system #####
# - ad_api_adaptors
# - ad_api_visualizers
# - automatic_pose_initializer
# - autoware_component_monitor
# - autoware_default_adapi
# - autoware_processing_time_checker
# - bluetooth_monitor
# - component_state_monitor
# - diagnostic_graph_aggregator
# - diagnostic_graph_utils
# - dummy_diag_publisher
# - dummy_infrastructure
# - duplicated_node_checker
# - hazard_status_converter
# - mrm_comfortable_stop_operator
# - mrm_emergency_stop_operator
# - mrm_handler
# - system_diagnostic_monitor
# - system_monitor
# - topic_state_monitor
# - velodyne_monitor
##### vehicle #####
# - autoware_accel_brake_map_calibrator
# - autoware_external_cmd_converter
- autoware_raw_vehicle_cmd_converter
# - autoware_steer_offset_estimator
Loading