ci: bump actions/checkout from 6 to 7 #406
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: Code Quality | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| bench-flags: | |
| runs-on: ubuntu-latest | |
| name: bench-flag guard | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: BMS ADBMS safety overrides must not be enabled in source | |
| run: ./scripts/check-bench-flags.sh | |
| clang-format: | |
| runs-on: ubuntu-latest | |
| name: clang-format check | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Install clang-format-18 | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clang-format-18 | |
| sudo ln -sf /usr/bin/clang-format-18 /usr/bin/clang-format | |
| - name: Check formatting (user code) | |
| run: ./scripts/format.sh --check | |
| cppcheck: | |
| runs-on: ubuntu-latest | |
| name: cppcheck ${{ matrix.project }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Sensor_Nodes ships in two variants (FRONT, REAR) but cppcheck | |
| # operates on the shared source tree. Run it once with both variants | |
| # explored via -D arguments below. | |
| project: [BMS, PCU, DASH, LVPDB, DART, DCU, DCU_Receiver, Sensor_Nodes, UART, UART_TEST] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Check if project has source code | |
| id: check | |
| run: | | |
| if [ ! -d "${{ matrix.project }}/Core" ]; then | |
| echo "skip=true" >> "$GITHUB_OUTPUT" | |
| echo "::warning::${{ matrix.project }} has no Core/ directory, skipping cppcheck." | |
| else | |
| echo "skip=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Install cppcheck | |
| if: steps.check.outputs.skip != 'true' | |
| run: sudo apt-get install -y cppcheck | |
| - name: Run cppcheck | |
| if: steps.check.outputs.skip != 'true' | |
| working-directory: ${{ matrix.project }} | |
| run: | | |
| # For Sensor_Nodes, supply the variant macros so the FEB_SN_Config.h | |
| # validation #error doesn't fire on the cppcheck preprocessor pass. | |
| # Other projects ignore these defines. | |
| cppcheck \ | |
| --enable=warning,performance,portability \ | |
| --suppress=missingIncludeSystem \ | |
| --suppress=unmatchedSuppression \ | |
| --suppress=uninitvar:*lsm6dsox_reg.c* \ | |
| --suppress=legacyUninitvar:*lsm6dsox_reg.c* \ | |
| --suppress=uninitStructMember:*lsm6dsox_reg.c* \ | |
| --error-exitcode=1 \ | |
| --inline-suppr \ | |
| -DFEB_SN_VARIANT_FRONT=1 \ | |
| -DFEB_SN_VARIANT_REAR=2 \ | |
| -DFEB_SENSOR_NODE_VARIANT=1 \ | |
| -I Core/User/Inc \ | |
| -i Drivers \ | |
| -i Middlewares \ | |
| Core/ \ | |
| 2>&1 |