diff --git a/.github/workflows/rust_and_ros2.yml b/.github/workflows/rust_and_ros2.yml new file mode 100644 index 0000000..3d74501 --- /dev/null +++ b/.github/workflows/rust_and_ros2.yml @@ -0,0 +1,35 @@ +name: Rust + +on: + push: + branches: [ github_actions ] + pull_request: + branches: [ github_actions ] + +env: + CARGO_TERM_COLOR: always + +jobs: + testing_rolling: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - run: docker build . --file ./tests/Dockerfile --tag r2r_test + - run: docker run r2r_test + + testing_foxy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - run: docker build . --file ./tests/Dockerfile_foxy --tag r2r_test + - run: docker run r2r_test + + testing_galactic: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - run: docker build . --file ./tests/Dockerfile_galactic --tag r2r_test + - run: docker run r2r_test diff --git a/tests/Dockerfile b/tests/Dockerfile new file mode 100644 index 0000000..a5f4003 --- /dev/null +++ b/tests/Dockerfile @@ -0,0 +1,6 @@ +FROM kristoferb/spdesktop_ros2:rolling + +COPY . /r2r +RUN rm /bin/sh && ln -s /bin/bash /bin/sh +RUN chmod +x /r2r/tests/test.sh +ENTRYPOINT [ "/r2r/tests/test.sh" ] diff --git a/tests/Dockerfile_foxy b/tests/Dockerfile_foxy new file mode 100644 index 0000000..3c38457 --- /dev/null +++ b/tests/Dockerfile_foxy @@ -0,0 +1,6 @@ +FROM kristoferb/spdesktop_ros2:foxy + +COPY . /r2r +RUN rm /bin/sh && ln -s /bin/bash /bin/sh +RUN chmod +x /r2r/tests/test.sh +ENTRYPOINT [ "/r2r/tests/test.sh" ] diff --git a/tests/Dockerfile_galactic b/tests/Dockerfile_galactic new file mode 100644 index 0000000..4b41a39 --- /dev/null +++ b/tests/Dockerfile_galactic @@ -0,0 +1,6 @@ +FROM kristoferb/spdesktop_ros2:galactic + +COPY . /r2r +RUN rm /bin/sh && ln -s /bin/bash /bin/sh +RUN chmod +x /r2r/tests/test.sh +ENTRYPOINT [ "/r2r/tests/test.sh" ] diff --git a/tests/test.sh b/tests/test.sh new file mode 100644 index 0000000..02a6998 --- /dev/null +++ b/tests/test.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +source /opt/ros/rolling/setup.bash +source /opt/ros/foxy/setup.bash +source /opt/ros/galactic/setup.bash + +cd /r2r/ +/root/.cargo/bin/cargo test \ No newline at end of file