11name : CI
2+
23on :
34 push :
45 branches :
56 - main
67 tags : ['*']
78 pull_request :
89 workflow_dispatch :
10+
911concurrency :
10- # Skip intermediate builds: always.
11- # Cancel intermediate builds: only if it is a pull request build.
1212 group : ${{ github.workflow }}-${{ github.ref }}
1313 cancel-in-progress : ${{ startsWith(github.ref, 'refs/pull/') }}
14+
1415jobs :
1516 test :
1617 name : Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
1718 runs-on : ${{ matrix.os }}
1819 timeout-minutes : 60
19- permissions : # needed to allow julia-actions/cache to proactively delete old caches that it has created
20+ permissions :
2021 actions : write
2122 contents : read
2223 strategy :
@@ -26,15 +27,76 @@ jobs:
2627 - ' lts'
2728 - ' 1'
2829 os :
29- - ubuntu-latest
30+ - ubuntu-22.04
3031 arch :
3132 - x64
33+
3234 steps :
33- - uses : actions/checkout@v4
34- - uses : julia-actions/setup-julia@v2
35+ # Checkout the code
36+ - name : Checkout Repository
37+ uses : actions/checkout@v4
38+
39+ # Set up Julia environment
40+ - name : Set up Julia
41+ uses : julia-actions/setup-julia@v2
3542 with :
3643 version : ${{ matrix.version }}
3744 arch : ${{ matrix.arch }}
38- - uses : julia-actions/cache@v2
39- - uses : julia-actions/julia-buildpkg@v1
40- - uses : julia-actions/julia-runtest@v1
45+
46+ # Cache Julia dependencies
47+ - name : Cache Julia Dependencies
48+ uses : julia-actions/cache@v2
49+
50+ # Set up ROS 2
51+ - name : Set up ROS 2 Humble
52+ run : |
53+ # Add ROS 2 repository
54+ sudo apt update
55+ sudo apt install -y curl gnupg lsb-release
56+ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
57+ sudo sh -c 'echo "deb [arch=amd64] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
58+
59+ # Install ROS 2
60+ sudo apt update
61+ sudo apt install -y ros-humble-desktop
62+
63+ # Install ROS dependencies
64+ - name : Install ROS Dependencies
65+ run : |
66+ sudo apt install -y \
67+ python3-colcon-common-extensions \
68+ python3-rosdep \
69+ python3-vcstool
70+
71+ # Initialize rosdep
72+ - name : Initialize rosdep
73+ run : |
74+ sudo rosdep init
75+ rosdep update
76+
77+ # Prepare ROS environment
78+ - name : Prepare ROS Environment
79+ run : |
80+ # Create a script to source ROS setup
81+ echo '#!/bin/bash
82+ source /opt/ros/humble/setup.bash' > $GITHUB_WORKSPACE/ros_setup.sh
83+ chmod +x $GITHUB_WORKSPACE/ros_setup.sh
84+
85+ # Run tests with ROS environment
86+ - name : Run Tests
87+ run : |
88+ $GITHUB_WORKSPACE/ros_setup.sh
89+ source /opt/ros/humble/setup.bash
90+ julia --project=. -e 'using Pkg; Pkg.test()'
91+ shell : bash
92+
93+ # Optional: Upload coverage
94+ - name : Upload Coverage
95+ uses : codecov/codecov-action@v3
96+ if : success()
97+ with :
98+ token : ${{ secrets.CODECOV_TOKEN }}
99+ files : ./lcov.info
100+ flags : unittests
101+ name : codecov-umbrella
102+ fail_ci_if_error : false
0 commit comments