From be4b7acf72aef3b47ee7617066769e57a6ecd30e Mon Sep 17 00:00:00 2001 From: Kristofer Bengtsson Date: Tue, 6 Jul 2021 09:21:12 +0200 Subject: [PATCH] GitHub actions (#15) Testing using github actions to build r2r in foxy, galactic and rolling --- .github/workflows/rust_and_ros2.yml | 35 +++++++++++++++++++++++++++++ tests/Dockerfile | 6 +++++ tests/Dockerfile_foxy | 6 +++++ tests/Dockerfile_galactic | 6 +++++ tests/test.sh | 8 +++++++ 5 files changed, 61 insertions(+) create mode 100644 .github/workflows/rust_and_ros2.yml create mode 100644 tests/Dockerfile create mode 100644 tests/Dockerfile_foxy create mode 100644 tests/Dockerfile_galactic create mode 100644 tests/test.sh 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