Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Caching and parallel test execution #85

Merged
merged 59 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
e33fd0d
initial commit
Nikhil-Singhal-06 May 8, 2024
1de64a1
fix path
Nikhil-Singhal-06 May 8, 2024
91fe190
fix docker file path
Nikhil-Singhal-06 May 8, 2024
66508eb
add examples tests
Nikhil-Singhal-06 May 8, 2024
8e8e2df
removce ign source
Nikhil-Singhal-06 May 8, 2024
0441ad0
add xvfb
Nikhil-Singhal-06 May 13, 2024
76da272
optimize docker image
Nikhil-Singhal-06 May 13, 2024
2cc2f01
update name
Nikhil-Singhal-06 May 13, 2024
e3b3721
update name
Nikhil-Singhal-06 May 13, 2024
e29e8d9
fix typo
Nikhil-Singhal-06 May 13, 2024
0cd72ec
delete package
Nikhil-Singhal-06 May 13, 2024
4143017
add test run
Nikhil-Singhal-06 May 13, 2024
af451d5
add example test
Nikhil-Singhal-06 May 13, 2024
8b8f00a
add results
Nikhil-Singhal-06 May 13, 2024
eb3dce6
fix error
Nikhil-Singhal-06 May 13, 2024
8efb9b5
fix issues
Nikhil-Singhal-06 May 13, 2024
c4fedaf
remove ign
Nikhil-Singhal-06 May 13, 2024
36a79cf
test result upload
Nikhil-Singhal-06 May 13, 2024
22865b7
fix result path
Nikhil-Singhal-06 May 13, 2024
9b5c9e5
fix linting error
Nikhil-Singhal-06 May 13, 2024
bff8ca7
final commit
Nikhil-Singhal-06 May 13, 2024
bbe31b6
unittest
Nikhil-Singhal-06 May 13, 2024
4b659ef
Merge branch 'main' into upgrade_ci
fred-labs Jun 19, 2024
7f26101
cleanup dockerfile
fred-labs Jun 19, 2024
b703c9c
cleanup dockerfile
fred-labs Jun 19, 2024
afb5639
fix dockefile
fred-labs Jun 19, 2024
03975ed
test
fred-labs Jun 19, 2024
bdd80d1
speedup
fred-labs Jun 19, 2024
253213d
speedup
fred-labs Jun 19, 2024
3322832
speedup
fred-labs Jun 19, 2024
de45a0a
speedup
fred-labs Jun 19, 2024
4d39833
speedup
fred-labs Jun 19, 2024
b379841
test
fred-labs Jun 19, 2024
04b0ffe
test
fred-labs Jun 19, 2024
f62f4f8
clenaup
fred-labs Jun 19, 2024
8fef2f8
clenaup
fred-labs Jun 19, 2024
cb40d13
use cache
fred-labs Jun 19, 2024
b425a14
cleanup
fred-labs Jun 19, 2024
2990763
cleanup
fred-labs Jun 19, 2024
6d783b9
cleanup
fred-labs Jun 19, 2024
193425c
cleanup
fred-labs Jun 19, 2024
d16073e
cleanup
fred-labs Jun 19, 2024
ef5c2fe
cleanup
fred-labs Jun 19, 2024
0ff08b6
cleanup
fred-labs Jun 19, 2024
4273bb0
cleanup
fred-labs Jun 19, 2024
7580752
cleanup
fred-labs Jun 19, 2024
0b05a07
cleanup
fred-labs Jun 19, 2024
6a52efb
cleanup
fred-labs Jun 19, 2024
0f73418
cleanup
fred-labs Jun 19, 2024
4c46ebc
cleanup
fred-labs Jun 19, 2024
28aa446
cleanup
fred-labs Jun 19, 2024
4c476ac
cleanup
fred-labs Jun 19, 2024
53f27aa
summizare
fred-labs Jun 19, 2024
693ffe8
Merge branch 'main' into upgrade_ci
fred-labs Jun 20, 2024
259b3b1
cleanup
fred-labs Jun 20, 2024
fb40b7e
set 10m
fred-labs Jun 20, 2024
7b6f8f5
set 10m
fred-labs Jun 20, 2024
69c9927
a
fred-labs Jun 20, 2024
5675337
a
fred-labs Jun 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Cleanup
Fixed Show fixed Hide fixed
on:
workflow_run:
workflows: ["test-build"]
types:
- completed

jobs:
build-and-cache:
#TODO model dependency to image-workflow. Workaround: retrigger run after image-workflow finished.
runs-on: intellabs-01
steps:
- name: Build
shell: bash
run: |
ls -l
265 changes: 182 additions & 83 deletions .github/workflows/test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,53 @@ on:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
build:
build-and-cache:
#TODO model dependency to image-workflow. Workaround: retrigger run after image-workflow finished.
runs-on: intellabs-01
container:
image: osrf/ros:humble-desktop-full
permissions:
# checks: write
pull-requests: write
image: ghcr.io/intellabs/scenario-execution:humble
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- name: Build
shell: bash
run: |
env
false
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
submodules: true
- name: Setup Dependencies
run: |
apt update
apt install -y python3-pip
xargs -a deb_requirements.txt apt install -y --no-install-recommends
rosdep update --rosdistro=humble
rosdep install --rosdistro=humble --from-paths . --ignore-src -r -y
pip3 install -r requirements.txt
- name: Build
shell: bash
run: |
source /opt/ros/humble/setup.bash
colcon build --continue-on-error
source install/setup.bash
- name: Cache Build
id: cache-test-id
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: .
key: ${{ runner.os }}-build-${{ github.ref }}
#-${{ hashFiles('.') }}
# restore-key: ${{ runner.os }}-build-${{ github.ref }}
run-tests:
needs: [build-and-cache]
runs-on: intellabs-01
container:
image: ghcr.io/intellabs/scenario-execution:humble
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Restore cache
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ runner.os }}-build-${{ github.ref }}
path: .
- name: Test
shell: bash
run: |
Expand All @@ -64,47 +84,22 @@ jobs:
scenario_execution//TEST.xml
scenario_execution_ros//TEST.xml
scenario_execution_gazebo//TEST.xml
scenario_coverage//TEST.xml
test-scenarios:
scenario_coverage//TEST.xml
scenario-files-dry-run:
needs: [build-and-cache]
runs-on: intellabs-01
container:
image: osrf/ros:humble-desktop
permissions:
# checks: write
pull-requests: write
image: ghcr.io/intellabs/scenario-execution:humble
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- name: Restore cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
submodules: true
- name: Setup Dependencies
run: |
apt update
apt install -y xvfb tk
apt install -y libgl1
apt install -y python3-pip
xargs -a deb_requirements.txt apt install -y --no-install-recommends
rosdep update --rosdistro=humble
rosdep install --rosdistro=humble --from-paths . --ignore-src -r -y
apt install -y ros-humble-gazebo-ros2-control
pip3 install -r requirements.txt
- name: Build IGN_ROS_CONTROL # build from source for now because base package has errors.
shell: bash
run: |
mkdir -p /ros_ign/src
cd /ros_ign/src
git clone --branch humble https://github.com/ros-controls/gz_ros2_control.git
rosdep install -r --from-paths . --ignore-src --rosdistro humble -y
cd /ros_ign
source /opt/ros/humble/setup.bash
colcon build --continue-on-error
source install/setup.bash
- name: Build
shell: bash
run: |
source /opt/ros/humble/setup.bash
colcon build --continue-on-error
source install/setup.bash
- name: Test Scenario Files Syntax
key: ${{ runner.os }}-build-${{ github.ref }}
path: .
- name: Test Scenario Files
shell: bash
run: |
source /opt/ros/humble/setup.bash
Expand All @@ -113,20 +108,74 @@ jobs:
echo "$file";
ros2 run scenario_execution scenario_execution "$file" -n;
done
test-example-scenario:
needs: [build-and-cache]
runs-on: intellabs-01
container:
image: ghcr.io/intellabs/scenario-execution:humble
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Restore cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ runner.os }}-build-${{ github.ref }}
path: .
- name: Test Example Scenario
shell: bash
run: |
source /opt/ros/humble/setup.bash
source install/setup.bash
#shellcheck disable=SC1083
scenario_batch_execution -i examples/example_scenario/ -o test_example_scenario -- ros2 launch scenario_execution_ros scenario_launch.py scenario:={SCENARIO} output_dir:={OUTPUT_DIR}
- name: Upload result
uses: actions/upload-artifact@ef09cdac3e2d3e60d8ccadda691f4f1cec5035cb
if: always()
with:
name: test-example-scenario-result
path: test_example_scenario/test.xml
test-example-library:
needs: [build-and-cache]
runs-on: intellabs-01
container:
image: ghcr.io/intellabs/scenario-execution:humble
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Restore cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ runner.os }}-build-${{ github.ref }}
path: .
- name: Test Example Library
shell: bash
run: |
source /opt/ros/humble/setup.bash
source install/setup.bash
# shellcheck disable=SC1083
scenario_batch_execution -i examples/example_library/scenarios -o test_example_library -- ros2 launch scenario_execution_ros scenario_launch.py scenario:={SCENARIO} output_dir:={OUTPUT_DIR}
- name: Upload result
uses: actions/upload-artifact@ef09cdac3e2d3e60d8ccadda691f4f1cec5035cb
if: always()
with:
name: test-example-library-result
path: test_example_library/test.xml
test-example-variation:
needs: [build-and-cache]
runs-on: intellabs-01
container:
image: ghcr.io/intellabs/scenario-execution:humble
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Restore cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ runner.os }}-build-${{ github.ref }}
path: .
- name: Test Example Variation
shell: bash
run: |
Expand All @@ -135,17 +184,29 @@ jobs:
scenario_variation -o scenario_variation_out examples/example_scenario_variation/example_scenario_variation.osc
# shellcheck disable=SC1083
scenario_batch_execution -i scenario_variation_out -o test_example_variation -- ros2 launch scenario_execution_ros scenario_launch.py scenario:={SCENARIO} output_dir:={OUTPUT_DIR}
- name: Test Example Scenario Control
shell: bash
run: |
source /opt/ros/humble/setup.bash
source install/setup.bash
mkdir test_example_control
python3 scenario_execution_control/test/scenario_execution_control_test_ci.py
- name: Upload result
uses: actions/upload-artifact@ef09cdac3e2d3e60d8ccadda691f4f1cec5035cb
if: always()
with:
name: test-example-variation-result
path: test_example_variation/test.xml
test-example-nav2:
needs: [build-and-cache]
runs-on: intellabs-01
container:
image: ghcr.io/intellabs/scenario-execution:humble
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Restore cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ runner.os }}-build-${{ github.ref }}
path: .
- name: Test Example Nav2
shell: bash
run: |
source /ros_ign/install/setup.bash
source /opt/ros/humble/setup.bash
source install/setup.bash
Xvfb :1 -screen 0 800x600x16 &
Expand All @@ -156,10 +217,29 @@ jobs:
sed -i 's/60s/600s/g' examples/example_nav2/example_nav2.osc
# shellcheck disable=SC1083
scenario_batch_execution -i examples/example_nav2/ -o test_example_nav2 -- ros2 launch tb4_sim_scenario sim_nav_scenario_launch.py scenario:={SCENARIO} output_dir:={OUTPUT_DIR}
- name: Upload result
uses: actions/upload-artifact@ef09cdac3e2d3e60d8ccadda691f4f1cec5035cb
if: always()
with:
name: test-example-nav2-result
path: test_example_nav2/test.xml
test-example-simulation:
needs: [build-and-cache]
runs-on: intellabs-01
container:
image: ghcr.io/intellabs/scenario-execution:humble
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Restore cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ runner.os }}-build-${{ github.ref }}
path: .
- name: Test Example Simulation
shell: bash
run: |
source /ros_ign/install/setup.bash
source /opt/ros/humble/setup.bash
source install/setup.bash
Xvfb :1 -screen 0 800x600x16 &
Expand All @@ -170,10 +250,30 @@ jobs:
sed -i 's/120s/900s/g' examples/example_simulation/scenarios/example_simulation.osc
# shellcheck disable=SC1083
scenario_batch_execution -i examples/example_simulation/scenarios/ -o test_example_simulation -- ros2 launch tb4_sim_scenario sim_nav_scenario_launch.py scenario:={SCENARIO} output_dir:={OUTPUT_DIR}
- name: Upload result
uses: actions/upload-artifact@ef09cdac3e2d3e60d8ccadda691f4f1cec5035cb
if: always()
with:
name: test-example-simulation-result
path: test_example_simulation/test.xml
test-example-multirobot:
needs: [build-and-cache]
runs-on: intellabs-01
container:
image: ghcr.io/intellabs/scenario-execution:humble
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Restore cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ runner.os }}-build-${{ github.ref }}
path: .
- name: Test Example Multirobot
shell: bash
run: |
source /ros_ign/install/setup.bash
false
source /opt/ros/humble/setup.bash
source install/setup.bash
Xvfb :1 -screen 0 800x600x16 &
Expand All @@ -184,6 +284,20 @@ jobs:
sed -i 's/240s/1500s/g' examples/example_multi_robot/example_multi_robot.osc
# shellcheck disable=SC1083
scenario_batch_execution -i examples/example_multi_robot/ -o test_example_multirobot -- ros2 launch tb4_sim_scenario sim_nav_scenario_launch.py scenario:={SCENARIO} yaw:=3.14 output_dir:={OUTPUT_DIR}
- name: Upload result
uses: actions/upload-artifact@ef09cdac3e2d3e60d8ccadda691f4f1cec5035cb
if: always()
with:
name: test-example-multirobot-result
path: test_example_multirobot/test.xml
publish-scenario-results:
needs: [test-example-scenario, test-example-library, test-example-variation, test-example-nav2, test-example-simulation, test-example-multirobot]
runs-on: intellabs-01
steps:
- name: Download all artifacts
uses: actions/download-artifact@7a1cd3216ca9260cd8022db641d960b1db4d1be4 #v4.0
with:
path: downloaded-artifacts
- name: Publish Scenario Results
uses: EnricoMi/publish-unit-test-result-action@f355d34d53ad4e7f506f699478db2dd71da9de5f #v2.15.1
if: always()
Expand All @@ -193,24 +307,9 @@ jobs:
action_fail: true
comment_mode: always
files: |
test_example_scenario/test.xml
test_example_library/test.xml
test_example_variation/test.xml
test_example_control/test.xml
test_example_nav2/test.xml
test_example_simulation/test.xml
test_example_multirobot/test.xml
- name: Upload Scenario Results
uses: actions/upload-artifact@ef09cdac3e2d3e60d8ccadda691f4f1cec5035cb
if: always()
with:
name: test-scenario-results
path: |
test_example_scenario/test.xml
test_example_library/test.xml
test_example_variation/test.xml
test_example_control/test.xml
test_example_nav2/test.xml
test_example_simulation/test.xml
test_example_nav2/test.xml
test_example_multirobot/test.xml
downloaded-artifacts/test-example-scenario-result/test.xml
downloaded-artifacts/test-example-library-result/test.xml
downloaded-artifacts/test-example-variation-result/test.xml
downloaded-artifacts/test-example-nav2-result/test.xml
downloaded-artifacts/test-example-simulation-result/test.xml
downloaded-artifacts/test-example-multirobot-result/test.xml
Loading