瀏覽代碼

ci: split build workflow

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Gerard Marull-Paretas 2 月之前
父節點
當前提交
98fffd9551

+ 59 - 0
.github/workflows/build-bootloader.yml

@@ -0,0 +1,59 @@
+name: Build Bootloader
+
+on:
+  push:
+    branches: [main]
+  pull_request:
+    branches: [main]
+    paths:
+      - '.github/workflows/build-bootloader.yml'
+      - 'platform/**'
+      - 'third_party/**'
+
+jobs:
+  build:
+    runs-on: ubuntu-24.04
+
+    container:
+      image: ghcr.io/pebble-dev/pebbleos-docker:v1
+
+    strategy:
+      matrix:
+        board: ["asterix"]
+
+    steps:
+      - name: Mark Github workspace as safe
+        run: git config --system --add safe.directory "${GITHUB_WORKSPACE}" 
+
+      - name: Checkout
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+          submodules: true
+
+      - name: Install Python dependencies
+        run: |
+          pip install -U pip
+          pip install -r requirements.txt
+
+      - name: Obtain platform name
+        id: get-platform
+        run: |
+          BOARD=${{ matrix.board }}
+          PLATFORM=${BOARD%%_*}
+          echo "platform=$PLATFORM" >> "$GITHUB_OUTPUT"
+
+      - name: Configure bootloader
+        working-directory: platform/${{ steps.get-platform.outputs.platform }}/boot
+        run: ./waf configure --board ${{ matrix.board }}
+
+      - name: Build bootloader
+        working-directory: platform/${{ steps.get-platform.outputs.platform }}/boot
+        run: ./waf build
+
+      - name: Store bootloader images
+        uses: actions/upload-artifact@v4
+        with:
+          name: bootloader-${{ matrix.board }}
+          path: |
+            platform/${{ steps.get-platform.outputs.platform }}/boot/build/tintin_boot.*

+ 61 - 0
.github/workflows/build-firmware.yml

@@ -0,0 +1,61 @@
+name: Build Firmware
+
+on:
+  push:
+    branches: [main]
+  pull_request:
+    branches: [main]
+    paths:
+      - '.github/workflows/build-firmware.yml'
+      - 'resources/**'
+      - 'sdk/**'
+      - 'src/**'
+      - 'stored_apps/**'
+      - 'tools/**'
+      - 'third_party/**'
+      - 'waftools/**'
+      - 'waf'
+      - 'wscript'
+
+jobs:
+  build:
+    runs-on: ubuntu-24.04
+
+    container:
+      image: ghcr.io/pebble-dev/pebbleos-docker:v1
+
+    strategy:
+      matrix:
+        board: ["snowy_bb2", "spalding_bb2", "silk_bb2", "asterix"]
+
+    steps:
+      - name: Mark Github workspace as safe
+        run: git config --system --add safe.directory "${GITHUB_WORKSPACE}" 
+
+      - name: Checkout
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+          submodules: true
+
+      - name: Install Python dependencies
+        run: |
+          pip install -U pip
+          pip install -r requirements.txt
+
+      - name: Configure
+        run: ./waf configure --board ${{ matrix.board }}
+
+      - name: Build
+        run: ./waf build
+
+      - name: Bundle
+        run: ./waf bundle
+
+      - name: Store
+        uses: actions/upload-artifact@v4
+        with:
+          name: firmware-${{ matrix.board }}
+          path: |
+            build/**/*.elf
+            build/**/*.pbz

+ 59 - 0
.github/workflows/build-prf.yml

@@ -0,0 +1,59 @@
+name: Build PRF
+
+on:
+  push:
+    branches: [main]
+  pull_request:
+    branches: [main]
+    paths:
+      - '.github/workflows/build-prf.yml'
+      - 'resources/**'
+      - 'src/**'
+      - 'tools/**'
+      - 'third_party/**'
+      - 'waftools/**'
+      - 'waf'
+      - 'wscript'
+
+jobs:
+  build:
+    runs-on: ubuntu-24.04
+
+    container:
+      image: ghcr.io/pebble-dev/pebbleos-docker:v1
+
+    strategy:
+      matrix:
+        board: ["asterix"]
+
+    steps:
+      - name: Mark Github workspace as safe
+        run: git config --system --add safe.directory "${GITHUB_WORKSPACE}" 
+
+      - name: Checkout
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+          submodules: true
+
+      - name: Install Python dependencies
+        run: |
+          pip install -U pip
+          pip install -r requirements.txt
+
+      - name: Configure
+        run: ./waf configure --board ${{ matrix.board }}
+
+      - name: Build
+        run: ./waf build_prf
+
+      - name: Bundle
+        run: ./waf bundle_prf
+
+      - name: Store
+        uses: actions/upload-artifact@v4
+        with:
+          name: prf-${{ matrix.board }}
+          path: |
+            build/**/*.elf
+            build/**/*.pbz

+ 58 - 0
.github/workflows/build-qemu.yml

@@ -0,0 +1,58 @@
+name: Build Firmware (QEMU)
+
+on:
+  push:
+    branches: [main]
+  pull_request:
+    branches: [main]
+    paths:
+      - '.github/workflows/build-qemu.yml'
+      - 'resources/**'
+      - 'sdk/**'
+      - 'src/**'
+      - 'stored_apps/**'
+      - 'tools/**'
+      - 'third_party/**'
+      - 'waftools/**'
+      - 'waf'
+      - 'wscript'
+
+jobs:
+  build:
+    runs-on: ubuntu-24.04
+
+    container:
+      image: ghcr.io/pebble-dev/pebbleos-docker:v1
+
+    strategy:
+      matrix:
+        board: ["snowy_bb2", "spalding_bb2", "silk_bb2"]
+
+    steps:
+      - name: Mark Github workspace as safe
+        run: git config --system --add safe.directory "${GITHUB_WORKSPACE}" 
+
+      - name: Checkout
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+          submodules: true
+
+      - name: Install Python dependencies
+        run: |
+          pip install -U pip
+          pip install -r requirements.txt
+
+      - name: Configure
+        run: ./waf configure --board ${{ matrix.board }} --qemu
+
+      - name: Build
+        run: ./waf build qemu_image_micro qemu_image_spi
+
+      - name: Store
+        uses: actions/upload-artifact@v4
+        with:
+          name: firmware-${{ matrix.board }}-qemu
+          path: |
+            build/qemu_micro_flash.bin
+            build/qemu_spi_flash.bin

+ 0 - 109
.github/workflows/build.yml

@@ -1,109 +0,0 @@
-name: Build
-
-on:
-  push:
-    branches: [main]
-  pull_request:
-    branches: [main]
-    paths:
-      - '.github/workflows/build.yml'
-      - 'platform/**'
-      - 'resources/**'
-      - 'sdk/**'
-      - 'src/**'
-      - 'stored_apps/**'
-      - 'tools/**'
-      - 'third_party/**'
-      - 'waftools/**'
-      - 'waf'
-      - 'wscript'
-
-jobs:
-  build:
-    runs-on: ubuntu-24.04
-    container:
-      image: ghcr.io/pebble-dev/pebbleos-docker:v1
-    strategy:
-      matrix:
-        board: ["snowy_bb2", "spalding_bb2", "silk_bb2", "asterix"]
-    steps:
-      - name: Mark Github workspace as safe
-        run: git config --system --add safe.directory "${GITHUB_WORKSPACE}" 
-
-      - name: Checkout
-        uses: actions/checkout@v4
-        with:
-          fetch-depth: 0
-          submodules: true
-
-      - name: Install Python dependencies
-        run: |
-          pip install -U pip
-          pip install -r requirements.txt
-
-      - name: Configure
-        run: ./waf configure --board ${{ matrix.board }}
-
-      - name: Build FW
-        run: ./waf build
-
-      - name: Bundle
-        run: ./waf bundle
-
-      - name: Build recovery FW
-        if: ${{ matrix.board == 'asterix' }}
-        run: ./waf build_prf
-
-      - name: Bundle recovery FW
-        if: ${{ matrix.board == 'asterix' }}
-        run: ./waf bundle_prf
-
-      - name: Store firmware bundles
-        uses: actions/upload-artifact@v4
-        with:
-          name: firmware-${{ matrix.board }}
-          path: |
-            build/**/*.elf
-            build/**/*.pbz
-
-      - name: Obtain platform name
-        id: get-platform
-        run: |
-          BOARD=${{ matrix.board }}
-          PLATFORM=${BOARD%%_*}
-          echo "platform=$PLATFORM" >> "$GITHUB_OUTPUT"
-
-      - name: Configure bootloader
-        if: ${{ matrix.board == 'asterix' }}
-        working-directory: platform/${{ steps.get-platform.outputs.platform }}/boot
-        run: ./waf configure --board ${{ matrix.board }}
-
-      - name: Build bootloader
-        if: ${{ matrix.board == 'asterix' }}
-        working-directory: platform/${{ steps.get-platform.outputs.platform }}/boot
-        run: ./waf build
-
-      - name: Store bootloader images
-        if: ${{ matrix.board == 'asterix' }}
-        uses: actions/upload-artifact@v4
-        with:
-          name: bootloader-${{ matrix.board }}
-          path: |
-            platform/${{ steps.get-platform.outputs.platform }}/boot/build/tintin_boot.*
-
-      - name: Configure (QEMU)
-        if: ${{ matrix.board != 'asterix' }}
-        run: ./waf clean configure --board ${{ matrix.board }} --qemu
-
-      - name: Build FW (QEMU)
-        if: ${{ matrix.board != 'asterix' }}
-        run: ./waf build qemu_image_micro qemu_image_spi
-
-      - name: Store firmware images (QEMU)
-        if: ${{ matrix.board != 'asterix' }}
-        uses: actions/upload-artifact@v4
-        with:
-          name: firmware-${{ matrix.board }}-qemu
-          path: |
-            build/qemu_micro_flash.bin
-            build/qemu_spi_flash.bin

+ 1 - 1
README.md

@@ -7,7 +7,7 @@
 </p>
 
 <p align="center">
-  <a href="https://github.com/pebble-dev/pebble-firmware/actions/workflows/build.yml?query=branch%3Amain"><img src="https://github.com/pebble-dev/pebble-firmware/actions/workflows/build.yml/badge.svg?branch=main"></a>
+  <a href="https://github.com/pebble-dev/pebble-firmware/actions/workflows/build-firmware.yml?query=branch%3Amain"><img src="https://github.com/pebble-dev/pebble-firmware/actions/workflows/build-firmware.yml/badge.svg?branch=main"></a>
   <a href="https://pebbleos.readthedocs.io/en/latest"><img src="https://readthedocs.org/projects/pebbleos/badge/?version=latest&style=flat"></a>
   <a href="https://discordapp.com/invite/aRUAYFN"><img src="https://dcbadge.limes.pink/api/server/aRUAYFN?style=flat"></a>
 </p>