Skip to content

Commit

Permalink
Split out CI jobs (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-bass authored Oct 1, 2023
1 parent 89e385b commit 5f39069
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,36 @@ jobs:
# Always publish test results even when there are failures.
if: ${{ always() }}

# Testing with ROS 2
# Build and test with ROS 2
ros2-test:
strategy:
matrix:
ros_distro: [humble, iron, rolling]
env:
ROS_DISTRO: ${{ matrix.ros_distro }}

name: ros-${{ matrix.ros_distro }}-test
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Run unit tests in Docker container
run: docker compose run test
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker
- name: Build Docker image
uses: docker/build-push-action@v5
with:
file: docker/Dockerfile
context: .
build-args: |
ROS_DISTRO=${{ matrix.ros_distro }}
tags: pyrobosim:${{ matrix.ros_distro }}
- name: Run tests
run: |
docker run \
--volume ./test/:/pyrobosim_ws/test/:rw \
--volume ./pytest.ini:/pyrobosim_ws/pytest.ini:rw \
pyrobosim:${{ matrix.ros_distro }} \
/bin/bash -c './test/run_tests.bash'
- name: Upload test results
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

services:
base:
image: pyrobosim-${ROS_DISTRO:-humble}
image: pyrobosim:${ROS_DISTRO:-humble}
build:
context: .
dockerfile: docker/Dockerfile
Expand Down

0 comments on commit 5f39069

Please sign in to comment.