Skip to content

Update format.yml

Update format.yml #924

Workflow file for this run

name: format
on:
workflow_dispatch:
pull_request:
push:
jobs:
pre-commit:
name: pre-commit
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
env:
DEBIAN_FRONTEND: noninteractive
TZ: Asia/Shanghai
PRE_COMMIT_PYTHON: python3
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
apt-get update
apt-get install -y wget gnupg lsb-release python3 python3-pip git
- name: Install clang-format-10
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main" > /etc/apt/sources.list.d/llvm.list
apt-get update
apt-get install -y clang-format-10
- name: Install catkin-lint
run: |
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
apt-get update
apt-get install -y python3-catkin-lint
- name: Install pre-commit
run: |
pip install --no-cache-dir pre-commit
- name: Debug environment
run: |
echo "Python version:"
python3 --version
echo "Installed Python packages:"
pip freeze
echo "Git version:"
git --version
echo "Clang-format version:"
clang-format-10 --version
echo "Catkin-lint version:"
catkin_lint --version
- name: Clear pre-commit cache
run: |
rm -rf /github/home/.cache/pre-commit
- name: Run pre-commit
run: |
pre-commit run --all-files --verbose