|
| 1 | +name: WolfBoot CMake Build (Windows) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "*" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "*" ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + windows-cmake: |
| 11 | + name: Build on Windows (CMake + Ninja) |
| 12 | + runs-on: windows-latest |
| 13 | + timeout-minutes: 20 |
| 14 | + |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + target: |
| 19 | + - stm32l4 |
| 20 | + - stm32h7 |
| 21 | + include: |
| 22 | + # Optional per-target cache variables you might want to pass later. |
| 23 | + # Keep empty for now to avoid guessing addresses. |
| 24 | + - target: stm32l4 |
| 25 | + extra_cache: "" |
| 26 | + - target: stm32h7 |
| 27 | + extra_cache: "" |
| 28 | + |
| 29 | + steps: |
| 30 | + - name: Checkout (with submodules) |
| 31 | + uses: actions/checkout@v4 |
| 32 | + with: |
| 33 | + submodules: true |
| 34 | + |
| 35 | + # ARM GCC toolchain (adds the bin dir to PATH) |
| 36 | + - name: Set up ARM none-eabi GCC 14.x |
| 37 | + uses: carlosperate/arm-none-eabi-gcc-action@v1 |
| 38 | + with: |
| 39 | + version: "14.2.Rel1" # <-- use 'release', not 'version' |
| 40 | + path-env-var: ARM_NONE_EABI_GCC_PATH |
| 41 | + |
| 42 | + # CMake + Ninja are preinstalled on windows-latest, but verify & print versions |
| 43 | + - name: Tool versions |
| 44 | + shell: bash |
| 45 | + run: | |
| 46 | + echo "Compiler versions:" |
| 47 | + arm-none-eabi-gcc --version |
| 48 | + echo |
| 49 | + echo "CMake:" |
| 50 | + cmake --version |
| 51 | + echo |
| 52 | + echo "Ninja:" |
| 53 | + ninja --version |
| 54 | + echo |
| 55 | + echo "MSVC (via vswhere):" |
| 56 | + cmd.exe /c "\"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe\" -latest -products * -requires Microsoft.Component.MSBuild -property installationVersion" |
| 57 | +
|
| 58 | + - name: Build via cmd inline |
| 59 | + shell: cmd |
| 60 | + run: | |
| 61 | + if exist build-windows-stm32l4 rmdir /s /q build-windows-stm32l4 |
| 62 | + cmake --preset windows-stm32l4 |
| 63 | + cmake --build --preset windows-stm32l4 --parallel %NUMBER_OF_PROCESSORS% |
| 64 | +
|
| 65 | + - name: Build via batch (cmd) |
| 66 | + shell: cmd |
| 67 | + run: | |
| 68 | + :: # Call my_test.bat |
| 69 | +
|
| 70 | + call my_test.bat |
| 71 | +
|
| 72 | + - name: Configure (CMake + Ninja) |
| 73 | + shell: bash |
| 74 | + run: | |
| 75 | + # cmake runs in git bash |
| 76 | + echo "disabled" |
| 77 | +
|
| 78 | + #BUILD_DIR="build-${{ matrix.target }}" |
| 79 | + #cmake -S . -B "$BUILD_DIR" -G Ninja \ |
| 80 | + # -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain_arm-none-eabi.cmake \ |
| 81 | + # -DWOLFBOOT_CONFIG_MODE=preset \ |
| 82 | + # -DWOLFBOOT_TARGET=${{ matrix.target }} \ |
| 83 | + # -DBUILD_TEST_APPS=ON \ |
| 84 | + # ${{ matrix.extra_cache }} |
| 85 | + #echo "Configured: $BUILD_DIR" |
| 86 | +
|
| 87 | + - name: Build |
| 88 | + shell: bash |
| 89 | + run: | |
| 90 | + # cmake runs in git bash |
| 91 | + BUILD_DIR="build-${{ matrix.target }}" |
| 92 | + cmake --build "$BUILD_DIR" --parallel |
| 93 | +
|
| 94 | + # Optional: show interesting artifacts |
| 95 | + - name: List build outputs |
| 96 | + if: always() |
| 97 | + shell: bash |
| 98 | + run: | |
| 99 | + BUILD_DIR="build-${{ matrix.target }}" |
| 100 | + echo "=== Artifacts in $BUILD_DIR ===" |
| 101 | + find "$BUILD_DIR" -maxdepth 3 -type f \( -name "*.elf" -o -name "*.bin" -o -name "*.hex" -o -name "bin-assemble" -o -name "keystore" \) -print || true |
| 102 | +
|
| 103 | + # Upload binaries if present (non-fatal if none) |
| 104 | + - name: Upload firmware/artifacts |
| 105 | + if: always() |
| 106 | + uses: actions/upload-artifact@v4 |
| 107 | + with: |
| 108 | + name: wolfboot-${{ matrix.target }} |
| 109 | + path: | |
| 110 | + build-${{ matrix.target }}/**/*.elf |
| 111 | + build-${{ matrix.target }}/**/*.bin |
| 112 | + build-${{ matrix.target }}/**/*.hex |
| 113 | + if-no-files-found: warn |
0 commit comments