1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- # https://github.com/raspberrypi/pico-examples/blob/master/.github/workflows/cmake.yml
-
- name: Firmware
-
- # build for each push and pull request
- on: [push, pull_request]
-
- env:
- BUILD_TYPE: Release
-
- jobs:
- build:
- runs-on: ubuntu-latest
-
- permissions:
- contents: write
-
- steps:
- - name: Install dependencies
- run: sudo apt-get install -y cxxtest build-essential gcc-arm-none-eabi mtools zip
-
- - name: Checkout repo
- uses: actions/checkout@v4
- with:
- path: repo
- fetch-depth: 0
-
- - name: Checkout repo submodules
- working-directory: ${{github.workspace}}/repo
- run: git submodule update --init
-
- - name: Checkout pico-sdk submodules
- working-directory: ${{github.workspace}}/repo/firmware/pico-sdk
- run: git submodule update --init
-
- - name: Create Build Environment
- working-directory: ${{github.workspace}}/repo/firmware
- run: cmake -E make_directory ${{github.workspace}}/repo/firmware/build
-
- - name: Configure CMake
- shell: bash
- working-directory: ${{github.workspace}}/repo/firmware/build
- run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
-
- - name: Get core count
- id: core_count
- run : cat /proc/cpuinfo | grep processor | wc -l
-
- - name: Build
- working-directory: ${{github.workspace}}/repo/firmware/build
- shell: bash
- run: cmake --build . --config $BUILD_TYPE --parallel $(nproc)
-
- - name: Upload a Build Artifact
- uses: actions/upload-artifact@v4.0.0
- with:
- name: dispensy.uf2
- path: ${{github.workspace}}/repo/firmware/build/dispensy.uf2
- if-no-files-found: error
-
- - name: Upload release files
- if: startsWith(github.ref, 'refs/tags/')
- uses: softprops/action-gh-release@v1
- with:
- files: ${{github.workspace}}/repo/firmware/build/dispensy.uf2
|