fix: rewrite clean target to avoid Windows command line length limit #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build ARM Firmware | |
| # ----------------------------------------------------------------------------- | |
| # Workflow triggers | |
| # ----------------------------------------------------------------------------- | |
| # - Runs automatically on push to the main branch | |
| # - Runs on pull requests targeting main | |
| # - Can also be triggered manually from the GitHub Actions UI | |
| # ----------------------------------------------------------------------------- | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - STM32F746G-DISCO_REV.C | |
| pull_request: | |
| branches: | |
| - main | |
| - STM32F746G-DISCO_REV.C | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build Firmware | |
| runs-on: ubuntu-latest | |
| steps: | |
| # ----------------------------------------------------------------------- | |
| # Step 1 - Checkout the current repository | |
| # Retrieves the project source code so the workflow can build it. | |
| # ----------------------------------------------------------------------- | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # ----------------------------------------------------------------------- | |
| # Step 2 - Install the ARM GCC toolchain | |
| # Installs the ARM GNU compiler used to build the firmware. | |
| # Version used: 10.3-2021.10 | |
| # ----------------------------------------------------------------------- | |
| - name: Install Arm GNU Toolchain (arm-none-eabi-gcc) | |
| uses: carlosperate/arm-none-eabi-gcc-action@v1 | |
| with: | |
| release: "10.3-2021.10" | |
| # ----------------------------------------------------------------------- | |
| # Step 3 - Mark sym2srec as executable | |
| # Git does not always preserve executable permissions on Linux. | |
| # sym2srec is committed directly in the repository and must be | |
| # executable before the Makefile calls it during the link step. | |
| # ----------------------------------------------------------------------- | |
| - name: Set sym2srec executable permission | |
| run: chmod +x Mk/Make/sym2srec | |
| # ----------------------------------------------------------------------- | |
| # Step 4 - Build the firmware using the Makefile | |
| # - Cleans previous build artifacts | |
| # - Compiles the project | |
| # ----------------------------------------------------------------------- | |
| - name: Build using Makefile | |
| run: | | |
| cd Mk/Make/ | |
| make clean | |
| make all | |
| # ----------------------------------------------------------------------- | |
| # Step 5 - Upload build artifacts | |
| # Uploads the generated firmware files (.elf, .map, .srec) so they can | |
| # be downloaded from the GitHub Actions interface. | |
| # | |
| # The step is skipped when running locally with "act" because artifact | |
| # upload requires the GitHub runtime environment. | |
| # ----------------------------------------------------------------------- | |
| - name: Upload build artifacts | |
| if: ${{ !env.ACT }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: firmware | |
| path: | | |
| Mk/Make/*.elf | |
| Mk/Make/*.map | |
| Mk/Make/*.srec |