From 9db7aeddfde08d623349058e3892c3190e3bd692 Mon Sep 17 00:00:00 2001 From: Eric Cai Date: Sat, 5 Sep 2026 18:58:00 -0400 Subject: [PATCH] ci: add GitHub workflow for Ruff checks and build tests --- .github/workflows/ci.yml | 51 ++++++++++++++++++++++++++++++++++++++++ ruff.toml | 2 ++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 ruff.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f5bcfe6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: ROS CI + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ros-ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-24.04 + timeout-minutes: 5 + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + - name: Lint Python with Ruff + uses: astral-sh/ruff-action@v4.0.0 + with: + version: "0.14.6" + args: "check --output-format=github" + - name: Check Python formatting + run: ruff format --check . + + build: + runs-on: ubuntu-24.04 + timeout-minutes: 20 + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + - name: Build Lyrical development image + run: docker build --pull -t boat-ci setup + - name: Build workspace and run package tests + run: | + docker run --rm \ + -v "$GITHUB_WORKSPACE/src:/home/ros2_user/ros2_ws/src:ro" \ + boat-ci bash -c ' + set -e + test_status=0 + colcon test --return-code-on-test-failure || test_status=$? + colcon test-result --verbose + exit "$test_status" + ' diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..e88dfa3 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,2 @@ +target-version = "py314" +extend-exclude = ["install", "log"]