Merge pull request #48 from macaris64/feat/phase-40-sitl-integration #5
This file contains hidden or 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
| # SAKURA-II SITL Integration Smoke Test | |
| # | |
| # Runs the four-stack docker compose SITL scenario. | |
| # Triggers: push to master, workflow_dispatch only. | |
| # NOT triggered on pull_request (too slow / requires Gazebo + ROS 2 Docker images). | |
| # | |
| # Gate: integration smoke test passes when: | |
| # - cFS 9-app initialization completes | |
| # - Gazebo physics starts | |
| # - ROS 2 teleop_node reaches lifecycle active | |
| # - Ground station binds UDP socket | |
| # - orbiter_comm HK (APID 0x120) routes to HK sink | |
| # - No forbidden APID (0x540-0x543) appears on the RF path (Q-F2) | |
| name: Integration Smoke | |
| on: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| concurrency: | |
| group: integration-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| sitl-smoke: | |
| name: sitl-smoke | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Check cFE submodule | |
| id: cfe-present | |
| run: | | |
| if [ -f "cfs/cFE/CMakeLists.txt" ]; then | |
| echo "present=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "present=false" >> $GITHUB_OUTPUT | |
| echo "cfs/cFE not initialized — SITL test requires cFS runtime; skipping." | |
| fi | |
| - name: Install system dependencies | |
| if: steps.cfe-present.outputs.present == 'true' | |
| run: | | |
| sudo apt-get update -q | |
| sudo apt-get install -y --no-install-recommends \ | |
| cmake ninja-build gcc g++ libcmocka-dev \ | |
| docker-compose-plugin | |
| - name: Build cFS runtime | |
| if: steps.cfe-present.outputs.present == 'true' | |
| run: | | |
| cmake -B build_cfs -DCMAKE_BUILD_TYPE=Release -DSAKURA_CFS_RUNTIME=ON | |
| cmake --build build_cfs --parallel $(nproc) | |
| - name: Build Rust ground station | |
| if: steps.cfe-present.outputs.present == 'true' | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| - name: Cache Cargo | |
| if: steps.cfe-present.outputs.present == 'true' | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-integration-${{ hashFiles('rust/Cargo.lock') }} | |
| - name: Build ground station binary | |
| if: steps.cfe-present.outputs.present == 'true' | |
| run: cargo build -p ground_station --release | |
| - name: Start SITL stack (mock Gazebo + ROS 2) | |
| if: steps.cfe-present.outputs.present == 'true' | |
| run: | | |
| # Use a lightweight mock of Gazebo/ROS2 for CI (full Gazebo Docker too slow). | |
| # The smoke test validates cFS startup + ground station UDP binding only. | |
| TIMEOUT_CFS=30 TIMEOUT_GZ=5 TIMEOUT_ROS2=5 TIMEOUT_GS=10 \ | |
| timeout 120 bash scripts/start_full_stack.sh & | |
| STACK_PID=$! | |
| sleep 45 # allow stacks to initialize | |
| bash scripts/integration_smoke_test.sh | |
| kill "${STACK_PID}" 2>/dev/null || true | |
| - name: Upload SITL logs | |
| if: always() && steps.cfe-present.outputs.present == 'true' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sitl-logs | |
| path: .sitl_logs/ | |
| retention-days: 7 |