diff options
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/format.yml | 2 | ||||
| -rw-r--r-- | .github/workflows/main.yml | 48 | ||||
| -rw-r--r-- | .github/workflows/pr-comment.yml | 12 |
3 files changed, 45 insertions, 17 deletions
diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 71c05fa2..ceb37d5b 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -29,7 +29,7 @@ jobs: run: tests/test-format.sh - name: Upload patches - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: Patches diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89c1b276..8e8677f3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,6 +22,8 @@ jobs: text_size: ${{ steps.output-sizes.outputs.text_size }} data_size: ${{ steps.output-sizes.outputs.data_size }} bss_size: ${{ steps.output-sizes.outputs.bss_size }} + firmware_artifact: ${{ steps.upload-firmware.outputs.artifact-id }} + resources_artifact: ${{ steps.upload-resources.outputs.artifact-id }} env: # InfiniTime sources are downloaded to the current directory. # Override SOURCES_DIR in build.sh @@ -31,9 +33,15 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive + - name: Install resource build dependencies + run: | + apt-get update + apt-get -y install --no-install-recommends python3-pil - name: Build shell: bash - run: /opt/build.sh all + run: | + git config --global --add safe.directory /__w/InfiniTime/InfiniTime + /opt/build.sh all - name: Output build size id: output-sizes run: | @@ -42,29 +50,41 @@ jobs: # Unzip the package because Upload Artifact will zip up the files - name: Unzip DFU package run: unzip ./build/output/pinetime-mcuboot-app-dfu-*.zip -d ./build/output/pinetime-mcuboot-app-dfu + - name: Set ref_name, but replace slashes with dashes. + shell: bash + env: + ref_name: ${{ github.head_ref || github.ref_name }} + run: echo "REF_NAME=${ref_name//\//-}" >> $GITHUB_ENV - name: Upload DFU artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: InfiniTime DFU ${{ github.head_ref }} + name: InfiniTime DFU ${{ env.REF_NAME }} path: ./build/output/pinetime-mcuboot-app-dfu/* - name: Upload MCUBoot image artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: InfiniTime MCUBoot image ${{ github.head_ref }} + name: InfiniTime MCUBoot image ${{ env.REF_NAME }} path: ./build/output/pinetime-mcuboot-app-image-*.bin + - name: Upload standalone ELF artifacts + uses: actions/upload-artifact@v4 + id: upload-firmware + with: + name: InfiniTime image ${{ env.REF_NAME }} + path: ./build/output/src/pinetime-app-*.out - name: Upload resources artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 + id: upload-resources with: - name: InfiniTime resources ${{ github.head_ref }} + name: InfiniTime resources ${{ env.REF_NAME }} path: ./build/output/infinitime-resources-*.zip build-simulator: runs-on: ubuntu-22.04 steps: - - name: Install SDL2 development package + - name: Install SDL2 and libpng development package run: | sudo apt-get update - sudo apt-get -y install libsdl2-dev + sudo apt-get -y install libsdl2-dev libpng-dev - name: Install Ninja run: | @@ -82,7 +102,7 @@ jobs: - name: Get InfiniSim repo run: | git clone https://github.com/InfiniTimeOrg/InfiniSim.git --depth 1 --branch main - git -C InfiniSim submodule update --init lv_drivers libpng + git -C InfiniSim submodule update --init lv_drivers - name: CMake # disable BUILD_RESOURCES as this is already done when building the firmware @@ -94,9 +114,9 @@ jobs: cmake --build build_lv_sim - name: Upload simulator executable - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: infinisim-${{ github.head_ref }} + name: infinisim-${{ env.REF_NAME }} path: build_lv_sim/infinisim get-base-ref-size: @@ -191,10 +211,12 @@ jobs: | text | ${{ needs.build-firmware.outputs.text_size }}B | ${{ steps.output-sizes-diff.outputs.text_diff }}B | | data | ${{ needs.build-firmware.outputs.data_size }}B | ${{ steps.output-sizes-diff.outputs.data_diff }}B | | bss | ${{ needs.build-firmware.outputs.bss_size }}B | ${{ steps.output-sizes-diff.outputs.bss_diff }}B | + + [Run in InfiniEmu](https://infiniemu.pipe01.net/?firmware=artifact://${{ github.repository }}/${{ needs.build-firmware.outputs.firmware_artifact }}&resources=artifact://${{ github.repository }}/${{ needs.build-firmware.outputs.resources_artifact }}) EOF - name: Upload comment - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: comment path: comment diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml index 15f0c02d..a8705d31 100644 --- a/.github/workflows/pr-comment.yml +++ b/.github/workflows/pr-comment.yml @@ -23,9 +23,16 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} - if: steps.wait-for-build.outputs.conclusion != 'success' - run: exit 1 + run: | + tee comment << EOF + Build checks have not completed. Possible reasons for this are: + 1. The checks need to be approved by a maintainer + 2. The branch has conflicts + 3. The firmware build has failed + EOF - - name: Download artifact + - if: steps.wait-for-build.outputs.conclusion == 'success' + name: Download artifact uses: dawidd6/action-download-artifact@bd10f381a96414ce2b13a11bfa89902ba7cea07f with: workflow: main.yml @@ -39,7 +46,6 @@ jobs: with: issue-number: ${{ github.event.pull_request.number }} comment-author: 'github-actions[bot]' - body-includes: Build size and comparison to - name: Create or update comment uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808 |
