Skip to content

Commit

Permalink
Update GitHub workflows to use Docker, and Focal (#401)
Browse files Browse the repository at this point in the history
This pull request introduces two changes:

a/ lint.yml is using the latest version of action-ros-lint, and runs it on
   a Docker image built by ros-tooling/setup-ros-docker.
   Using a docker image instead of ros-tooling/setup-ros removes the
   need for running APT, and other commands which requires internet
   connectivity and may become a source of flakyness in the CI pipeline.
   Instead, the worker runs a Docker image with the linter
   pre-installed.

b/ test.yml now uses a Focal docker image. This also allows us to skip
   invoking ros-tooling/setup-ros, which speeds up the CI, and reduces
   risks of flakyness.

Signed-off-by: Thomas Moulard <[email protected]>
  • Loading branch information
thomas-moulard authored May 4, 2020
1 parent df6e83e commit 69c5893
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 19 deletions.
48 changes: 32 additions & 16 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
# Run linters automatically on pull requests.
#
# ros-tooling/actino-ros-lint is relying on the latest APT binary packages.
# As of 2020-05-01, Eloquent is the latest release for which APT binary
# packages are available, which is why the Docker image is based on Eloquent.
name: Lint rosbag2
on:
pull_request:

jobs:
ament_copyright:
name: ament_copyright
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-bionic-ros-eloquent-ros-base-latest
steps:
- uses: actions/checkout@v1
- uses: ros-tooling/[email protected]
- uses: ros-tooling/[email protected]
# TODO(setup-ros-docker#7): calling chown is necessary for now
- run: sudo chown -R rosbuild:rosbuild "$HOME" .
- uses: actions/checkout@v2
- uses: ros-tooling/[email protected]
with:
linter: copyright
package-name: |
Expand All @@ -25,11 +32,14 @@ jobs:
ament_xmllint:
name: ament_xmllint
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-bionic-ros-eloquent-ros-base-latest
steps:
- uses: actions/checkout@v1
- uses: ros-tooling/[email protected]
- uses: ros-tooling/[email protected]
# TODO(setup-ros-docker#7): calling chown is necessary for now
- run: sudo chown -R rosbuild:rosbuild "$HOME" .
- uses: actions/checkout@v2
- uses: ros-tooling/[email protected]
with:
linter: xmllint
package-name: |
Expand All @@ -46,15 +56,18 @@ jobs:
ament_lint_cpp: # Linters applicable to C++ packages
name: ament_${{ matrix.linter }}
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-bionic-ros-eloquent-ros-base-latest
strategy:
fail-fast: false
matrix:
linter: [cppcheck, cpplint, uncrustify]
steps:
- uses: actions/checkout@v1
- uses: ros-tooling/[email protected]
- uses: ros-tooling/[email protected]
# TODO(setup-ros-docker#7): calling chown is necessary for now
- run: sudo chown -R rosbuild:rosbuild "$HOME" .
- uses: actions/checkout@v2
- uses: ros-tooling/[email protected]
with:
linter: ${{ matrix.linter }}
package-name: |
Expand All @@ -68,15 +81,18 @@ jobs:
ament_lint_python: # Linters applicable to Python packages
name: ament_${{ matrix.linter }}
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-bionic-ros-eloquent-ros-base-latest
strategy:
fail-fast: false
matrix:
linter: [flake8, pep257]
steps:
- uses: actions/checkout@v1
- uses: ros-tooling/[email protected]
- uses: ros-tooling/[email protected]
# TODO(setup-ros-docker#7): calling chown is necessary for now
- run: sudo chown -R rosbuild:rosbuild "$HOME" .
- uses: actions/checkout@v2
- uses: ros-tooling/[email protected]
with:
linter: ${{ matrix.linter }}
package-name: |
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ on:

jobs:
build_and_test:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-focal-latest
steps:
- uses: ros-tooling/[email protected]
- uses: ros-tooling/[email protected]
# TODO(setup-ros-docker#7): calling chown is necessary for now
- run: sudo chown -R rosbuild:rosbuild "$HOME" .
- uses: ros-tooling/[email protected]
with:
package-name: |
ros2bag
Expand Down

0 comments on commit 69c5893

Please sign in to comment.