Skip to content

Commit

Permalink
Merge pull request #1 from Wiktor-99/ci_refactor
Browse files Browse the repository at this point in the history
CI refactor
  • Loading branch information
Wiktor-99 authored Aug 25, 2024
2 parents 50d454d + 5a9e877 commit 4a1ce4e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
7 changes: 7 additions & 0 deletions .github/actions/lint/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Lint
description: Lint using devcontainer
runs:
using: docker
image: ../../../.devcontainer/Dockerfile
entrypoint: .github/actions/lint/run.sh
10 changes: 10 additions & 0 deletions .github/actions/lint/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e

sudo apt-get update
source /opt/ros/$ROS_DISTRO/setup.bash
if [[ "ament_flake8" == "ament_${LINTER}" ]]; then
ament_${LINTER} . --config python_linter.flake8
else
ament_${LINTER}
fi
29 changes: 7 additions & 22 deletions .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,14 @@ jobs:
ament_lint_general:
name: ament_${{ matrix.linter }}
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest
strategy:
fail-fast: false
matrix:
linter: [xmllint, pep257]
linter: [xmllint, flake8, pep257]
steps:
- uses: actions/checkout@v4
- uses: ros-tooling/action-ros-lint@v0.1
with:
linter: ${{ matrix.linter }}
distribution: humble
package-name: human_detector
ament_flake8:
name: ament_flake8
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest
steps:
- uses: actions/checkout@v4
- uses: ros-tooling/action-ros-lint@v0.1
with:
linter: flake8
distribution: humble
package-name: human_detector
arguments: --config python_linter.flake8
- name: Checkout code
uses: actions/checkout@v4
- name: Run linter
uses: ./.github/actions/lint/
env:
LINTER: ${{ matrix.linter }}

0 comments on commit 4a1ce4e

Please sign in to comment.