feat(heaphook_rust): add aligned alloc #190
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build test | |
on: | |
pull_request: | |
types: | |
- labeled | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build_and_test: | |
if: ${{ github.event.label.name == 'run-build-test' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Check for .cpp or .hpp file changes | |
id: check_changes_cpp | |
run: | | |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E '\.cpp$|\.hpp|$'; then | |
echo ".cpp or .hpp or .rs files changed" | |
echo "cpp_changed=true" >> $GITHUB_ENV | |
else | |
echo "No .cpp or .hpp or .rs files changed" | |
echo "cpp_changed=false" >> $GITHUB_ENV | |
fi | |
- name: Check for .rs file changes | |
id: check_changes_rust | |
run: | | |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '\.rs$'; then | |
echo ".rs files changed" | |
echo "rust_changed=true" >> $GITHUB_ENV | |
else | |
echo "No .rs files changed" | |
echo "rust_changed=false" >> $GITHUB_ENV | |
fi | |
# TODO: Cache apt packages | |
- name: Cache ROS2 workspace | |
if: steps.check_changes_cpp.outputs.cpp_changed == 'true' || steps.check_changes_rust.outputs.rust_changed == 'true' | |
uses: actions/cache@v2 | |
with: | |
path: /opt/ros/humble | |
key: ${{ runner.os }}-ros2-${{ hashFiles('**/package.xml') }}-${{ hashFiles('**/CMakeLists.txt') }} | |
restore-keys: | | |
${{ runner.os }}-ros2- | |
- name: Setup ROS 2 environment | |
if: steps.check_changes_cpp.outputs.cpp_changed == 'true' || steps.check_changes_rust.outputs.rust_changed == 'true' | |
run: | | |
sudo apt update | |
sudo apt install -y software-properties-common curl | |
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null | |
sudo apt update | |
sudo DEBIAN_FRONTEND=noninteractive apt upgrade -y | |
sudo apt install -y ros-humble-desktop python3-colcon-common-extensions ros-humble-ament-cmake | |
- name: Install dependencies | |
if: steps.check_changes_cpp.outputs.cpp_changed == 'true' || steps.check_changes_rust.outputs.rust_changed == 'true' | |
run: | | |
source /opt/ros/humble/setup.bash | |
sudo apt install -y python3-rosdep | |
sudo rosdep init | |
rosdep update | |
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO | |
- name: Build src | |
if: steps.check_changes_cpp.outputs.cpp_changed == 'true' || steps.check_changes_rust.outputs.rust_changed == 'true' | |
run: | | |
source /opt/ros/humble/setup.bash | |
colcon build | |
- name: run tests | |
if: steps.check_changes_cpp.outputs.cpp_changed == 'true' || steps.check_changes_rust.outputs.rust_changed == 'true' | |
run: | | |
source /opt/ros/humble/setup.bash | |
colcon test --event-handlers console_cohesion+ | |
colcon test-result --verbose | |
- name: Setup Rust environment | |
if: steps.check_changes_rust.outputs.rust_changed == 'true' | |
run: | | |
rustup toolchain install nightly-2024-08-13 | |
rustup default nightly-2024-08-13 | |
rustup component add clippy rustfmt | |
- name: Run rustfmt on agnocast_heaphook_rust | |
if: steps.check_changes_rust.outputs.rust_changed == 'true' | |
run: | | |
cd src/agnocast_heaphook_rust | |
cargo fmt && git diff --exit-code | |
- name: Run clippy on agnocast_heaphook_rust | |
if: steps.check_changes_rust.outputs.rust_changed == 'true' | |
run: | | |
cd src/agnocast_heaphook_rust | |
cargo clippy -- --deny warnings | |
- name: Build agnocast_heaphook_rust | |
if: steps.check_changes_rust.outputs.rust_changed == 'true' | |
run: | | |
cd src/agnocast_heaphook_rust | |
cargo build |