From 71c86733375dac57415b38f0572997d23296c3a8 Mon Sep 17 00:00:00 2001 From: Victor Reijgwart Date: Wed, 4 Sep 2024 14:40:44 +0200 Subject: [PATCH] Run pre-commit directly on VM not in Docker --- .github/workflows/lint.yml | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9876de5cf..bf3801b35 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: C++ Library +name: Lint on: pull_request: @@ -11,24 +11,14 @@ jobs: pre-commit: name: Pre-commit runs-on: ubuntu-20.04 - container: - # NOTE: Pylint checks if all modules that are marked for import are - # available. At the time of writing, the python scripts in this repo - # only depend on modules that are present on noetic-ros-base-focal - # out of the box. If scripts are added later that depend on custom - # package (e.g. installed through rosdep or pulled in through - # vcstool), it'd make sense to run pre-commit in a full workspace - # container (such as ${{ needs.workspace-container.outputs.image }}) - # at the cost of a longer loading time on the CI actions runner. - image: ros:noetic-ros-base-focal steps: - name: Install pre-commit's dependencies run: | - apt-get update - apt-get install -q -y --no-install-recommends git python3-pip clang-format-11 cppcheck libxml2-utils wget + sudo apt-get update + sudo apt-get install -q -y --no-install-recommends git python3-pip clang-format-11 cppcheck libxml2-utils wget pip3 install pre-commit cpplint - wget -O /bin/hadolint https://github.com/hadolint/hadolint/releases/download/v2.8.0/hadolint-Linux-x86_64 - chmod +x /bin/hadolint + sudo wget -O /bin/hadolint https://github.com/hadolint/hadolint/releases/download/v2.8.0/hadolint-Linux-x86_64 + sudo chmod +x /bin/hadolint - name: Fetch the package's repository uses: actions/checkout@v4 @@ -48,6 +38,5 @@ jobs: shell: bash run: | echo "::add-matcher::./.github/problem-matchers/pre-commit.json" - source /opt/ros/noetic/setup.bash PRE_COMMIT_HOME=${{ env.PRE_COMMIT_DIR }} SKIP=no-commit-to-branch pre-commit run --all-files echo "::remove-matcher owner=problem-matcher-pre-commit::"