No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cmake.yml 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # https://github.com/raspberrypi/pico-examples/blob/master/.github/workflows/cmake.yml
  2. name: Firmware
  3. # build for each push and pull request
  4. on: [push, pull_request]
  5. env:
  6. BUILD_TYPE: Release
  7. jobs:
  8. build:
  9. runs-on: ubuntu-latest
  10. permissions:
  11. contents: write
  12. steps:
  13. - name: Install dependencies
  14. run: sudo apt-get install -y cxxtest build-essential gcc-arm-none-eabi mtools zip
  15. - name: Checkout repo
  16. uses: actions/checkout@v4
  17. with:
  18. path: repo
  19. fetch-depth: 0
  20. - name: Checkout repo submodules
  21. working-directory: ${{github.workspace}}/repo
  22. run: git submodule update --init
  23. - name: Checkout pico-sdk submodules
  24. working-directory: ${{github.workspace}}/repo/pico-sdk
  25. run: git submodule update --init
  26. - name: Create Build Environment
  27. working-directory: ${{github.workspace}}/repo
  28. run: cmake -E make_directory ${{github.workspace}}/repo/build
  29. - name: Configure CMake
  30. shell: bash
  31. working-directory: ${{github.workspace}}/repo/build
  32. run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
  33. - name: Get core count
  34. id: core_count
  35. run : cat /proc/cpuinfo | grep processor | wc -l
  36. - name: Build
  37. working-directory: ${{github.workspace}}/repo/build
  38. shell: bash
  39. run: cmake --build . --config $BUILD_TYPE --parallel $(nproc)
  40. - name: Upload a Build Artifact
  41. uses: actions/upload-artifact@v4.0.0
  42. with:
  43. name: firmware.uf2
  44. path: ${{github.workspace}}/repo/build/drumkit.uf2
  45. if-no-files-found: error
  46. - name: Upload a Build Artifact
  47. uses: actions/upload-artifact@v4.0.0
  48. with:
  49. name: update.elf
  50. path: ${{github.workspace}}/repo/build/drumkit.elf
  51. if-no-files-found: error
  52. - name: Archive release files
  53. if: startsWith(github.ref, 'refs/tags/')
  54. run: |
  55. cd ${{github.workspace}}/repo/build
  56. zip -r firmware drumkit.uf2 drumkit.elf
  57. - name: Upload release files
  58. if: startsWith(github.ref, 'refs/tags/')
  59. uses: softprops/action-gh-release@v1
  60. with:
  61. files: ${{github.workspace}}/repo/build/firmware.zip