|
| 1 | +name: CI Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, develop] |
| 6 | + pull_request: |
| 7 | + branches: [main, develop] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + build-arm-cortex-m4: |
| 12 | + name: Build Cortex-M4 (arm-none-eabi) |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: Install latest CMake |
| 17 | + uses: lukka/get-cmake@latest |
| 18 | + |
| 19 | + - name: Install ARM GNU Toolchain |
| 20 | + uses: carlosperate/arm-none-eabi-gcc-action@v1 |
| 21 | + with: |
| 22 | + release: "13.2.Rel1" |
| 23 | + |
| 24 | + - name: Install build dependencies |
| 25 | + run: | |
| 26 | + sudo apt-get update |
| 27 | + sudo apt-get install -y ninja-build |
| 28 | +
|
| 29 | + - name: Verify ARM toolchain |
| 30 | + run: arm-none-eabi-gcc --version |
| 31 | + |
| 32 | + - name: Checkout repository |
| 33 | + uses: actions/checkout@v4 |
| 34 | + with: |
| 35 | + submodules: recursive |
| 36 | + |
| 37 | + - name: Configure and Build Cortex-M4 |
| 38 | + run: cmake --workflow --preset on-target-cortex-m4-gcc-arm-none-eabi |
| 39 | + |
| 40 | + build-arm-cortex-m7: |
| 41 | + name: Build Cortex-M7 (arm-none-eabi) |
| 42 | + runs-on: ubuntu-latest |
| 43 | + |
| 44 | + steps: |
| 45 | + - name: Install latest CMake |
| 46 | + uses: lukka/get-cmake@latest |
| 47 | + |
| 48 | + - name: Install ARM GNU Toolchain |
| 49 | + uses: carlosperate/arm-none-eabi-gcc-action@v1 |
| 50 | + with: |
| 51 | + release: "13.2.Rel1" |
| 52 | + |
| 53 | + - name: Install build dependencies |
| 54 | + run: | |
| 55 | + sudo apt-get update |
| 56 | + sudo apt-get install -y ninja-build |
| 57 | +
|
| 58 | + - name: Verify ARM toolchain |
| 59 | + run: arm-none-eabi-gcc --version |
| 60 | + |
| 61 | + - name: Checkout repository |
| 62 | + uses: actions/checkout@v4 |
| 63 | + with: |
| 64 | + submodules: recursive |
| 65 | + |
| 66 | + - name: Configure and Build Cortex-M7 |
| 67 | + run: cmake --workflow --preset on-target-cortex-m7-gcc-arm-none-eabi |
| 68 | + |
| 69 | + build-native-gcc: |
| 70 | + name: Build and Test (native GCC) |
| 71 | + runs-on: ubuntu-latest |
| 72 | + |
| 73 | + steps: |
| 74 | + - name: Install latest CMake |
| 75 | + uses: lukka/get-cmake@latest |
| 76 | + |
| 77 | + - name: Install dependencies |
| 78 | + run: | |
| 79 | + sudo apt-get update |
| 80 | + sudo apt-get install -y ninja-build gcc g++ |
| 81 | +
|
| 82 | + - name: Verify GCC |
| 83 | + run: gcc --version |
| 84 | + |
| 85 | + - name: Checkout repository |
| 86 | + uses: actions/checkout@v4 |
| 87 | + with: |
| 88 | + submodules: recursive |
| 89 | + |
| 90 | + - name: Configure, Build, and Test |
| 91 | + run: cmake --workflow --preset on-host-native-gcc |
| 92 | + |
| 93 | + - name: Upload test results |
| 94 | + if: always() |
| 95 | + uses: actions/upload-artifact@v4 |
| 96 | + with: |
| 97 | + name: test-results-gcc |
| 98 | + path: build/native-gcc/Testing/**/*.xml |
| 99 | + if-no-files-found: ignore |
| 100 | + |
| 101 | + build-native-llvm: |
| 102 | + name: Build and Test (native LLVM) |
| 103 | + runs-on: ubuntu-latest |
| 104 | + |
| 105 | + steps: |
| 106 | + - name: Install latest CMake |
| 107 | + uses: lukka/get-cmake@latest |
| 108 | + |
| 109 | + - name: Install LLVM toolchain |
| 110 | + run: | |
| 111 | + wget https://apt.llvm.org/llvm.sh |
| 112 | + chmod +x llvm.sh |
| 113 | + sudo ./llvm.sh 20 |
| 114 | + sudo apt-get update |
| 115 | + sudo apt-get install -y ninja-build |
| 116 | + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-20 100 |
| 117 | + sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-20 100 |
| 118 | + sudo update-alternatives --install /usr/bin/lld lld /usr/bin/lld-20 100 |
| 119 | +
|
| 120 | + - name: Verify LLVM |
| 121 | + run: clang --version |
| 122 | + |
| 123 | + - name: Checkout repository |
| 124 | + uses: actions/checkout@v4 |
| 125 | + with: |
| 126 | + submodules: recursive |
| 127 | + |
| 128 | + - name: Configure, Build, and Test |
| 129 | + run: cmake --workflow --preset on-host-native-llvm |
| 130 | + |
| 131 | + - name: Upload test results |
| 132 | + if: always() |
| 133 | + uses: actions/upload-artifact@v4 |
| 134 | + with: |
| 135 | + name: test-results-llvm |
| 136 | + path: build/native-llvm/Testing/**/*.xml |
| 137 | + if-no-files-found: ignore |
0 commit comments