Skip to content

Commit

Permalink
CI: Fix Rust workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com>
  • Loading branch information
AndrejOrsula committed Jan 21, 2025
1 parent 4dfb4de commit bc2efa8
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ concurrency:

env:
MSRV: "1.80"
ROS_DISTRO: "humble"
CARGO_TERM_COLOR: always
PYTHON_PACKAGE_NAME: space_robotics_bench_py
GUI_PACKAGE_NAME: space_robotics_bench_gui
CRATE_NAME_PY: space_robotics_bench_py
CRATE_NAME_GUI: space_robotics_bench_gui

jobs:
rustfmt:
Expand Down Expand Up @@ -63,39 +64,45 @@ jobs:
toolchain: ${{ matrix.toolchain }}
components: clippy

- uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: ${{ env.ROS_DISTRO }}
- if: runner.os == 'Linux'
run: sed -e 's/azure.archive.ubuntu.com/us.archive.ubuntu.com/g' -e t -e d /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/nonazure.list

## cargo check
- name: cargo check
run: cargo check --workspace --exclude ${{ env.PYTHON_PACKAGE_NAME }} --exclude ${{ env.GUI_PACKAGE_NAME }} --all-targets --verbose
run: source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash && cargo check --workspace --exclude ${{ env.CRATE_NAME_PY }} --all-targets --verbose
- name: cargo check --no-default-features
run: cargo check --workspace --exclude ${{ env.PYTHON_PACKAGE_NAME }} --exclude ${{ env.GUI_PACKAGE_NAME }} --all-targets --no-default-features --verbose
run: source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash && cargo check --workspace --exclude ${{ env.CRATE_NAME_PY }} --all-targets --no-default-features --verbose
- name: cargo check --all-features
run: cargo check --workspace --exclude ${{ env.PYTHON_PACKAGE_NAME }} --exclude ${{ env.GUI_PACKAGE_NAME }} --all-targets --all-features --verbose
run: source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash && cargo check --workspace --exclude ${{ env.CRATE_NAME_PY }} --all-targets --all-features --verbose

## cargo test
- name: cargo test
run: cargo test --workspace --exclude ${{ env.PYTHON_PACKAGE_NAME }} --exclude ${{ env.GUI_PACKAGE_NAME }} --all-targets --verbose
run: source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash && cargo test --workspace --exclude ${{ env.CRATE_NAME_PY }} --all-targets --verbose
- name: cargo test --no-default-features
run: cargo test --workspace --exclude ${{ env.PYTHON_PACKAGE_NAME }} --exclude ${{ env.GUI_PACKAGE_NAME }} --all-targets --no-default-features --verbose
run: source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash && cargo test --workspace --exclude ${{ env.CRATE_NAME_PY }} --all-targets --no-default-features --verbose
- name: cargo test --all-features
run: cargo test --workspace --exclude ${{ env.PYTHON_PACKAGE_NAME }} --exclude ${{ env.GUI_PACKAGE_NAME }} --all-targets --all-features --verbose
run: source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash && cargo test --workspace --exclude ${{ env.CRATE_NAME_PY }} --all-targets --all-features --verbose

## cargo test --doc
- name: cargo test --doc
run: cargo test --workspace --exclude ${{ env.PYTHON_PACKAGE_NAME }} --exclude ${{ env.GUI_PACKAGE_NAME }} --doc --verbose
run: source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash && cargo test --workspace --exclude ${{ env.CRATE_NAME_PY }} --doc --verbose
- name: cargo test --doc --no-default-features
run: cargo test --workspace --exclude ${{ env.PYTHON_PACKAGE_NAME }} --exclude ${{ env.GUI_PACKAGE_NAME }} --doc --no-default-features --verbose
run: source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash && cargo test --workspace --exclude ${{ env.CRATE_NAME_PY }} --doc --no-default-features --verbose
- name: cargo test --doc --all-features
run: cargo test --workspace --exclude ${{ env.PYTHON_PACKAGE_NAME }} --exclude ${{ env.GUI_PACKAGE_NAME }} --doc --all-features --verbose
run: source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash && cargo test --workspace --exclude ${{ env.CRATE_NAME_PY }} --doc --all-features --verbose

## [stable] cargo clippy
- name: stable | cargo clippy
if: ${{ matrix.toolchain == 'stable' }}
run: cargo clippy --workspace --exclude ${{ env.PYTHON_PACKAGE_NAME }} --exclude ${{ env.GUI_PACKAGE_NAME }} --all-targets --all-features --no-deps --verbose -- --deny warnings
run: source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash && cargo clippy --workspace --exclude ${{ env.CRATE_NAME_PY }} --all-targets --all-features --no-deps --verbose -- --deny warnings

## [stable] cargo doc
- name: stable | cargo doc --document-private-items
if: ${{ matrix.toolchain == 'stable' }}
run: cargo doc --workspace --exclude ${{ env.PYTHON_PACKAGE_NAME }} --exclude ${{ env.GUI_PACKAGE_NAME }} --all-features --no-deps --document-private-items --verbose
run: source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash && cargo doc --workspace --exclude ${{ env.CRATE_NAME_PY }} --all-features --no-deps --document-private-items --verbose

## [stable] Code coverage
- name: stable | Install cargo llvm-cov for code coverage
Expand All @@ -104,7 +111,7 @@ jobs:
## [stable] Generate coverage with cargo llvm-cov
- name: stable | Generate coverage
if: ${{ matrix.toolchain == 'stable' }}
run: cargo llvm-cov --workspace --exclude ${{ env.PYTHON_PACKAGE_NAME }} --exclude ${{ env.GUI_PACKAGE_NAME }} --all-features --lcov --output-path lcov.info
run: source /opt/ros/${{ env.ROS_DISTRO }}/setup.bash && cargo llvm-cov --workspace --exclude ${{ env.CRATE_NAME_PY }} --all-features --lcov --output-path lcov.info
## [stable] Upload coverage to codecov.io
- name: stable | Upload coverage
if: ${{ matrix.toolchain == 'stable' }}
Expand Down

0 comments on commit bc2efa8

Please sign in to comment.