-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fixes GitHub automated build #294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,13 +9,17 @@ name: Build PineTime Firmware | |
| # When to run this Workflow... | ||
| on: | ||
|
|
||
| # Run this Workflow if a user presses the "Run workflow" button on GitHub | ||
| workflow_dispatch: | ||
| branches: [ master, nan_fix_build, develop ] | ||
|
|
||
| # Run this Workflow when files are updated (Pushed) in the "master" Branch | ||
| push: | ||
| branches: [ master ] | ||
| branches: [ develop, master ] | ||
|
|
||
| # Also run this Workflow when a Pull Request is created or updated in the "master" Branch | ||
| pull_request: | ||
| branches: [ master ] | ||
| branches: [ develop, master ] | ||
|
|
||
| # Steps to run for the Workflow | ||
| jobs: | ||
|
|
@@ -28,7 +32,7 @@ jobs: | |
|
|
||
| ######################################################################################### | ||
| # Download and Cache Dependencies | ||
|
|
||
| - name: Install cmake | ||
| uses: lukka/get-cmake@v3.18.3 | ||
|
|
||
|
|
@@ -45,11 +49,14 @@ jobs: | |
| - name: Install Embedded Arm Toolchain arm-none-eabi-gcc | ||
| if: steps.cache-toolchain.outputs.cache-hit != 'true' # Install toolchain if not found in cache | ||
| uses: fiam/arm-none-eabi-gcc@v1.0.2 | ||
| with: | ||
| with: | ||
| # GNU Embedded Toolchain for Arm release name, in the V-YYYY-qZ format (e.g. "9-2019-q4") | ||
| release: 9-2020-q2 | ||
| # Directory to unpack GCC to. Defaults to a temporary directory. | ||
| directory: ${{ runner.temp }}/arm-none-eabi | ||
| env: | ||
| # needed for set-env (https://github.com/actions/toolkit/issues/641) | ||
| ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' | ||
|
|
||
| - name: Check cache for nRF5 SDK | ||
| id: cache-nrf5sdk | ||
|
|
@@ -83,10 +90,16 @@ jobs: | |
| if: steps.cache-mcuboot.outputs.cache-hit != 'true' # Install MCUBoot if not found in cache | ||
| run: | | ||
| cd ${{ runner.temp }} | ||
| git clone --branch v1.5.0 https://github.com/JuulLabs-OSS/mcuboot | ||
| git clone --branch v1.5.0 https://github.com/mcu-tools/mcuboot | ||
|
|
||
| - name: Install imgtool dependencies | ||
| run: pip3 install --user -r ${{ runner.temp }}/mcuboot/scripts/requirements.txt | ||
| run: | | ||
| pip3 install --user -r ${{ runner.temp }}/mcuboot/scripts/requirements.txt | ||
|
|
||
| # cbor is a dependency that is not currently included in mcuboot requirements.txt | ||
| - name: Install imgtool dependencies (cbor) | ||
| run: | | ||
| pip3 install --user cbor | ||
|
|
||
| - name: Install adafruit-nrfutil | ||
| run: | | ||
|
|
@@ -99,6 +112,8 @@ jobs: | |
|
|
||
| - name: Checkout source files | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| submodules: 'true' | ||
|
|
||
| - name: Show files | ||
| run: set ; pwd ; ls -l | ||
|
|
@@ -124,12 +139,17 @@ jobs: | |
| run: | | ||
| cd build | ||
| make pinetime-mcuboot-app | ||
| echo "" | ||
|
|
||
| - name: Create firmware image | ||
| run: | | ||
| # The generated firmware binary looks like "pinetime-mcuboot-app-0.8.2.bin" | ||
| ls -l build/src/pinetime-mcuboot-app*.bin | ||
| ${{ runner.temp }}/mcuboot/scripts/imgtool.py create --align 4 --version 1.0.0 --header-size 32 --slot-size 475136 --pad-header build/src/pinetime-mcuboot-app*.bin build/src/pinetime-mcuboot-app-img.bin | ||
| IMGTOOL_INPUT_ARGUMENT=$( ls build/src | grep "pinetime-mcuboot-app-[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.bin" ) | ||
| echo "" | ||
| echo -e "\u001b[32m ${IMGTOOL_INPUT_ARGUMENT} \u001b[0m" | ||
| echo "" | ||
| ${{ runner.temp }}/mcuboot/scripts/imgtool.py create --align 4 --version 1.0.0 --header-size 32 --slot-size 475136 --pad-header build/src/${IMGTOOL_INPUT_ARGUMENT} build/src/pinetime-mcuboot-app-img.bin | ||
| ${{ runner.temp }}/mcuboot/scripts/imgtool.py verify build/src/pinetime-mcuboot-app-img.bin | ||
|
|
||
| - name: Create DFU package | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one also could be removed by enabling DFU in the Cmake step
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right! It was not the case before, but now, images and DFU files are generated directly by CMake so that you don't need to add custom step after the build. You can have a look at the docker file to see how it's done :
Previously, the post build script generated images and DFU, but now it just copies the binaries into the output folder. Basically, all you have to do is add |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this step should be deleted --
make pinetime-mcuboot-appalready does this (except the file name isimageinstead ofimg)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DavidVentura which step are you talking about here ?
Make pinetime-mcuboot-apporCreate firmware image