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"]