build: add workflows based on moveit #46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Format | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
permissions: | |
contents: read | |
jobs: | |
pre-commit: | |
name: pre-commit | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check clang-format installed | |
id: clang-format-check | |
run: | | |
must_be_installed=$(whereis clang-format | grep -q "^clang-format:$" && echo true || echo false) | |
echo "must_be_installed=$must_be_installed" >> "$GITHUB_OUTPUT" | |
- name: Install clang-format | |
if: ${{ steps.clang-format-check.outputs.must_be_installed }} | |
run: sudo apt update && sudo apt install clang-format -y | |
- name: Install catkin_lint | |
run: | | |
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' | |
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 | |
sudo apt-get -q update | |
sudo apt-get -q -y install python3-rosdep | |
sudo rm -rf /etc/ros/rosdep/* | |
sudo rosdep init | |
rosdep update | |
sudo apt-get -q -y install catkin-lint | |
export ROS_DISTRO=${{ inputs.distro }} | |
# - name: Setup python | |
# run: sudo apt install -q -y python-is-python3 python3-pip | |
- uses: actions/setup-python@v4 | |
- uses: pre-commit/[email protected] | |
id: precommit | |
- name: Upload pre-commit changes | |
if: failure() && steps.precommit.outcome == 'failure' | |
uses: rhaschke/upload-git-patch-action@main | |
with: | |
name: pre-commit |