diff --git a/.github/workflows/humble_docker_test.yaml b/.github/workflows/humble_docker_test.yaml index fb6b26b..66fc034 100644 --- a/.github/workflows/humble_docker_test.yaml +++ b/.github/workflows/humble_docker_test.yaml @@ -1,25 +1,20 @@ -name: Humble_test_with_docker_NativeROS_string +name: buid_and_test_with_docker_NativeROS_string on: push: branches: - "main" pull_request: - types: [opened, synchronize, labeled] + types: [opened, synchronize] jobs: ci: - runs-on: ${{ matrix.os }} - if: | - ((github.event.action == 'labeled') && (github.event.label.name == 'TESTING') && (github.base_ref == 'main' )) || - ((github.event.action == 'synchronize') && (github.base_ref == 'main') && contains(github.event.pull_request.labels.*.name, 'TESTING')) || - (github.ref_name == 'main') + runs-on: ubuntu-latest container: image: osrf/ros:${{ matrix.ros_distribution }}-desktop timeout-minutes: 5 strategy: fail-fast: false matrix: - os: [ubuntu-22.04] ros_distribution: [humble] steps: - name: Checkout code @@ -31,14 +26,14 @@ jobs: - name: Install Docker Compose run: sudo apt-get update && sudo apt-get install -y docker-compose - # docker-compose.yml を使ってコンテナを起動 + # runs containers using docker-compose.yml - name: Build and run containers run: docker-compose up -d - name: Wait for containers to start - run: sleep 20 # コンテナが確実に起動するのを待つ時間を長くする + run: sleep 20 # wait time for container startup. - name: List running containers - run: docker ps -a # 全コンテナが起動しているか確認 - - name: Show container logs # コンテナのログを確認する + run: docker ps -a # Check if all containers are running. + - name: Show container logs run: | docker logs app1 docker logs app2 @@ -56,7 +51,7 @@ jobs: docker exec -d app2 bash -c "nc -l -p 8080" # app1からapp2へのTCP接続を確認 docker exec app1 bash -c "echo 'Test' | nc -w 3 172.19.0.3 8080" - # app1: ビルドの準備 (chmod +x update_ip.sh と ./update_ip.sh の実行) + # app1: prepare build (chmod +x update_ip.sh と ./update_ip.sh の実行) - name: Prepare build in mros run: | docker cp $GITHUB_WORKSPACE app1:/root/ws_mros # ソースコードをapp1コンテナにコピー @@ -64,7 +59,7 @@ jobs: cd /root/ws_mros && chmod +x update_ip.sh && # 権限変更 ./update_ip.sh" # IPアドレス更新スクリプトの実行 - # app1: クリーンビルド + # app1: clean and build - name: Clean and build in mros run: | docker exec app1 bash -c " @@ -73,7 +68,7 @@ jobs: ls -la && bash build.bash clean && # クリーンアップ bash build.bash all test_echoback_string" - # app2: のコードをコンテナにコピーしてビルド + # app2: - name: Clone Native test stub source code to app2 and build and run run: | docker exec app2 bash -c " diff --git a/.github/workflows/humble_test.yaml b/.github/workflows/humble_test.yaml index 0464e49..bfb3b19 100644 --- a/.github/workflows/humble_test.yaml +++ b/.github/workflows/humble_test.yaml @@ -1,26 +1,22 @@ -name: ci_humble +#TODO fix file name and "name:" like "build and test" + +name: build_and_test on: push: branches: - "main" - - "feat/add_ci_config" pull_request: - types: [opened, synchronize, labeled] + types: [opened, synchronize ] jobs: - ci: - runs-on: ${{ matrix.os }} - if: | - ((github.event.action == 'labeled') && (github.event.label.name == 'TESTING') && (github.base_ref == 'main' )) || - ((github.event.action == 'synchronize') && (github.base_ref == 'main') && contains(github.event.pull_request.labels.*.name, 'TESTING')) || - (github.ref_name == 'main') + build_and_test: + runs-on: ubuntu-latest container: image: osrf/ros:${{ matrix.ros_distribution }}-desktop timeout-minutes: 3 strategy: fail-fast: false matrix: - os: [ubuntu-22.04] ros_distribution: [humble] comm-target: [native , mros] comm-data-type: [string, twist] @@ -74,19 +70,19 @@ jobs: shell: bash run : | ./test_echoback_${{ matrix.comm-data-type }}/mros2-posix & - mros_pid=$! # mROSのプロセスIDを取得 + mros_pid=$! # get mROS process id - # Native ROSをバックグラウンドで実行 + # Run Native ROS in background cd ws_host/ source /opt/ros/humble/setup.bash source install/setup.bash ros2 run mros2_echoreply_${{ matrix.comm-data-type }} echoreply_node & - # mROSが終了するまで待つ + # Wait until mROS finishes wait $mros_pid mros_status=$? - # 結果に基づいてCIの成否を判断 + # Judge CI success based on results if [ $mros_status -eq 0 ] ;then echo "Succeed pub/sub test process between mros2 and Native ROS" exit 0 @@ -99,16 +95,16 @@ jobs: shell: bash run : | ./test_echoback_${{ matrix.comm-data-type }}/mros2-posix & - mros_pid=$! # テストプログラムのプロセスIDを取得 + mros_pid=$! # get mROS process id - # テスト対象をバックグラウンドで実行 + # Run mROS responder in background ./cmake_build/mros2-posix & - # mROSが終了するまで待つ + # Wait until mROS finishes wait $mros_pid mros_status=$? - # 結果に基づいてCIの成否を判断 + # Judge CI success based on results if [ $mros_status -eq 0 ] ;then echo "Succeed pub/sub test process between mros2 and Native ROS" exit 0 diff --git a/README.md b/README.md index dd01bca..43c9b97 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ sudo apt-get update && sudo apt-get install -y \ libssl-dev libreadline-dev zlib1g-dev \ make autoconf automake cmake \ pkg-config curl \ - net-tools netcat jinja2 + net-tools netcat python3-jinja2 ``` Please check the IP address and netmask of the execution environment.