Skip to content

Commit

Permalink
Merge pull request #19 from ichiro-its/18-test-process-is-checking-th…
Browse files Browse the repository at this point in the history
…e-build-files

Move the copy command and add testcase
  • Loading branch information
segara2410 authored Mar 15, 2021
2 parents 7197c87 + 53399e6 commit 9411213
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test-ros2-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ jobs:
apt-packages: neofetch libopencv-dev
pip-packages: numpy matplotlib
post-install: neofetch && opencv_version && python3 -c 'import numpy; import matplotlib'
- name: Test with including external project
uses: ./
with:
ros2-distro: foxy
apt-packages: git ros-foxy-example-interfaces
pre-build: git clone -b foxy https://github.com/ros2/examples /ws/examples
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Although, The CI process is guaranteed to be fast (approximately 3-5 minutes, de

To be able to build and test the project inside the repository, This action requires [the Checkout action](https://github.com/marketplace/actions/checkout).
Before the build process, the project files will be put under the `/ws/repo` directory inside the container.
Then, the build and test process will be done using [colcon](https://colcon.readthedocs.io/en/released/index.html) inside the `/ws` directory and the results (`build`, `install`, and `log`) will be copied inside the `/ws/repo/.ws`.
Then, the build and test process will be done using [colcon](https://colcon.readthedocs.io/en/released/index.html) inside the `/ws` directory.
After the test process happens, the build results (`build`, `install`, and `log`) will be copied inside the `/ws/repo/.ws`.

The drawback of using this action is it still needs to install external dependencies that haven't been included in the ROS 2 default installation.
But that problem could be solved by adding a `apt-packages` or a `pip-packages` input inside the action configuration (see [this](#Install-Several-Dependencies)) or by cloning external packages inside the `/ws` directory before the build process happens (see [this](#Include-External-Project)).
Expand All @@ -39,15 +40,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Build and test
uses: ichiro-its/ros2-ci@v0.4.0
uses: ichiro-its/ros2-ci@v0.4.1
```
> This will be defaulted to use [ROS 2 Foxy Fitzroy](https://docs.ros.org/en/foxy/Releases/Release-Foxy-Fitzroy.html).
### Using Different ROS 2 Distributin
```yaml
- name: Build and test
uses: ichiro-its/ros2-ci@v0.4.0
uses: ichiro-its/ros2-ci@v0.4.1
with:
ros2-distro: rolling
```
Expand All @@ -56,7 +57,7 @@ jobs:
```yaml
- name: Build and test
uses: ichiro-its/ros2-ci@v0.4.0
uses: ichiro-its/ros2-ci@v0.4.1
with:
apt-packages: libssh-dev libopencv-dev
```
Expand All @@ -65,16 +66,16 @@ jobs:
```yaml
- name: Build and test
uses: ichiro-its/ros2-ci@v0.4.0
uses: ichiro-its/ros2-ci@v0.4.1
with:
post-build: ls .ws
post-test: ls .ws
```
### Include External Project
```yaml
- name: Build and test
uses: ichiro-its/ros2-ci@v0.4.0
uses: ichiro-its/ros2-ci@v0.4.1
with:
apt-packages: git
pre-build: git clone https://github.com/ros2/examples /ws/examples
Expand Down
12 changes: 6 additions & 6 deletions dind/ros2/entrypoint.bash
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ cd /ws && colcon build \
--event-handlers console_cohesion+ \
--cmake-args || exit $?

mkdir /ws/repo/.ws \
&& cp -r /ws/build /ws/repo/.ws \
&& cp -r /ws/log /ws/repo/.ws \
&& cp -r /ws/install /ws/repo/.ws \
|| exit $?

if [ ! -z "$POST_BUILD" ]; then
echo ''
echo '======== Running the post-build command ========'
Expand All @@ -86,6 +80,12 @@ cd /ws && colcon test \
--pytest-with-coverage \
--return-code-on-test-failure || exit $?

mkdir /ws/repo/.ws \
&& cp -r /ws/build /ws/repo/.ws \
&& cp -r /ws/log /ws/repo/.ws \
&& cp -r /ws/install /ws/repo/.ws \
|| exit $?

if [ ! -z "$POST_TEST" ]; then
echo ''
echo '======== Running the post-test command ========'
Expand Down

0 comments on commit 9411213

Please sign in to comment.