ci: scope workflow triggers to relevant path changes only #20
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
| name: Unit Tests | |
| on: | |
| push: | |
| branches: [ phoenix, main ] | |
| paths: | |
| - 'Controller/main/InverseKinematics.cpp' | |
| - 'Controller/main/AxisScaling.cpp' | |
| - 'Controller/main/MotionCueing.cpp' | |
| - 'Controller/include/**' | |
| - 'tests/**' | |
| - '.github/workflows/unit_tests.yml' | |
| pull_request: | |
| branches: [ phoenix, main ] | |
| paths: | |
| - 'Controller/main/InverseKinematics.cpp' | |
| - 'Controller/main/AxisScaling.cpp' | |
| - 'Controller/main/MotionCueing.cpp' | |
| - 'Controller/include/**' | |
| - 'tests/**' | |
| - '.github/workflows/unit_tests.yml' | |
| jobs: | |
| unit-tests: | |
| name: C Math Module Tests | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake build-essential | |
| - name: Configure CMake | |
| run: cmake -S tests -B tests/build -DCMAKE_BUILD_TYPE=Release | |
| - name: Build tests | |
| run: cmake --build tests/build --config Release | |
| - name: Run tests (Linux) | |
| if: runner.os == 'Linux' | |
| run: ./tests/build/stewart-tests | |
| - name: Run tests (Windows) | |
| if: runner.os == 'Windows' | |
| run: .\tests\build\Release\stewart-tests.exe |