Update radarsimcpp #222
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
| # ============================================================================== | |
| # GitHub Actions Workflow: MacOS Unit Testing (x64 & ARM64) | |
| # ============================================================================== | |
| # | |
| # This workflow performs continuous integration testing for RadarSimPy on | |
| # both MacOS x64 and ARM64 (Apple Silicon) platforms. It builds and tests the | |
| # radar simulation library across multiple Python versions to ensure compatibility | |
| # and reliability. | |
| # | |
| # Triggers: | |
| # - Push to master branch | |
| # - Pull requests targeting master branch | |
| # | |
| # Test Matrix: | |
| # - Python versions: 3.9, 3.10, 3.11, 3.12, 3.13 | |
| # - Platform: MacOS 13 (x64), MacOS 15 (ARM64) | |
| # - Compilers: GCC/G++ (x64), Clang/Clang++ (ARM64) | |
| # - Architecture: x64, arm64 (CPU-only builds) | |
| # | |
| # Key Features: | |
| # - Pip package caching for faster builds | |
| # - GCC/Clang and Xcode environment setup | |
| # - System information display for debugging | |
| # - Timeout protection (60 minutes) | |
| # - Fail-fast disabled to test all Python versions | |
| # | |
| # Requirements: | |
| # - RADARSIMC SSH key secret for submodule access | |
| # - Xcode 15.2 (x64), Xcode 16.3 (arm64), CMake, GCC/Clang, and Python dependencies | |
| # - build.sh script | |
| # | |
| # ============================================================================== | |
| name: MacOS Unit Tests | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| build: | |
| timeout-minutes: 60 | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # MacOS x64, GCC-14, Xcode 15.2 | |
| - arch: x64 | |
| runner: macos-13 | |
| c_compiler: gcc-14 | |
| cxx_compiler: g++-14 | |
| xcode: "15.2" | |
| os_label: macosx64 | |
| python-version: "3.9" | |
| - arch: x64 | |
| runner: macos-13 | |
| c_compiler: gcc-14 | |
| cxx_compiler: g++-14 | |
| xcode: "15.2" | |
| os_label: macosx64 | |
| python-version: "3.10" | |
| - arch: x64 | |
| runner: macos-13 | |
| c_compiler: gcc-14 | |
| cxx_compiler: g++-14 | |
| xcode: "15.2" | |
| os_label: macosx64 | |
| python-version: "3.11" | |
| - arch: x64 | |
| runner: macos-13 | |
| c_compiler: gcc-14 | |
| cxx_compiler: g++-14 | |
| xcode: "15.2" | |
| os_label: macosx64 | |
| python-version: "3.12" | |
| - arch: x64 | |
| runner: macos-13 | |
| c_compiler: gcc-14 | |
| cxx_compiler: g++-14 | |
| xcode: "15.2" | |
| os_label: macosx64 | |
| python-version: "3.13" | |
| # MacOS arm64, Clang, Xcode 16.3 | |
| - arch: arm64 | |
| runner: macos-15 | |
| c_compiler: clang | |
| cxx_compiler: clang++ | |
| xcode: "16.3" | |
| os_label: macosarm64 | |
| python-version: "3.9" | |
| - arch: arm64 | |
| runner: macos-15 | |
| c_compiler: clang | |
| cxx_compiler: clang++ | |
| xcode: "16.3" | |
| os_label: macosarm64 | |
| python-version: "3.10" | |
| - arch: arm64 | |
| runner: macos-15 | |
| c_compiler: clang | |
| cxx_compiler: clang++ | |
| xcode: "16.3" | |
| os_label: macosarm64 | |
| python-version: "3.11" | |
| - arch: arm64 | |
| runner: macos-15 | |
| c_compiler: clang | |
| cxx_compiler: clang++ | |
| xcode: "16.3" | |
| os_label: macosarm64 | |
| python-version: "3.12" | |
| - arch: arm64 | |
| runner: macos-15 | |
| c_compiler: clang | |
| cxx_compiler: clang++ | |
| xcode: "16.3" | |
| os_label: macosarm64 | |
| python-version: "3.13" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ssh-key: ${{secrets.RADARSIMC}} | |
| submodules: recursive | |
| - name: Set up Xcode | |
| uses: maxim-lobanov/setup-xcode@v1.6.0 | |
| with: | |
| xcode-version: ${{ matrix.xcode }} | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache pip packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/Library/Caches/pip | |
| key: ${{ matrix.arch == 'arm64' && format('{0}-arm64-pip-{1}', runner.os, hashFiles('**/requirements-dev.txt')) || format('{0}-pip-{1}', runner.os, hashFiles('**/requirements-dev.txt')) }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| ${{ runner.os }}-arm64-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements-dev.txt | |
| - name: Display system information | |
| run: | | |
| echo "Python version:" | |
| python --version | |
| echo "Pip version:" | |
| pip --version | |
| echo "CMake version:" | |
| cmake --version | |
| echo "Xcode version:" | |
| xcodebuild -version | |
| echo "C Compiler version:" | |
| ${{ matrix.c_compiler }} --version | |
| echo "C++ Compiler version:" | |
| ${{ matrix.cxx_compiler }} --version | |
| echo "Architecture:" | |
| uname -m | |
| - name: Build & Test | |
| env: | |
| CC: ${{ matrix.c_compiler }} | |
| CXX: ${{ matrix.cxx_compiler }} | |
| PYTHONPATH: ${{ github.workspace }} | |
| run: | | |
| chmod +x build.sh | |
| ./build.sh --tier=standard --arch=cpu --test=on | |
| - name: Display build logs on failure | |
| if: failure() | |
| run: | | |
| if [ -f "build/CMakeFiles/CMakeOutput.log" ]; then | |
| echo "=== CMake Output Log ===" | |
| tail -n 100 "build/CMakeFiles/CMakeOutput.log" | |
| fi | |
| if [ -f "build/CMakeFiles/CMakeError.log" ]; then | |
| echo "=== CMake Error Log ===" | |
| tail -n 100 "build/CMakeFiles/CMakeError.log" | |
| fi | |
| - name: Upload build logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-logs-python-${{ matrix.python-version }}-${{ matrix.arch }} | |
| path: build_logs/ | |
| retention-days: 1 | |
| if-no-files-found: warn |