Skip to content

progress towards decoupling cec and cdc functionality, et-al #143

progress towards decoupling cec and cdc functionality, et-al

progress towards decoupling cec and cdc functionality, et-al #143

Workflow file for this run

name: Pico-CEC Build
on:
push:
branches: [ "main" ]
tags:
- 'v*'
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
RELEASE_ZIP: pico-cec-${{github.ref_name}}.zip
RELEASE_BOARD: seeed_xiao_rp2040
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run clang-format style check
uses: jidicula/[email protected]
with:
clang-format-version: '17'
check-path: .
exclude-regex: '(crc\/.+|FreeRTOS-Kernel\/.+|pico-sdk\/.+|tcli\/.+)'
build:
needs: format
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pico_board:
- seeed_xiao_rp2040
- waveshare_rp2040_zero
- vcc_gnd_yd_2040
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Clone tinyusb
shell: bash
run: |
cd pico-sdk && git submodule update --init lib/tinyusb
- name: Install required packages
shell: bash
run: |
sudo apt install --no-install-recommends -y gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
- name: Configure CMake
run: cmake -B ${{github.workspace}}/${{matrix.pico_board}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DPICO_CEC_VERSION=${{github.ref_name}}
- name: Build Pico-CEC
run: cmake --build ${{github.workspace}}/${{matrix.pico_board}} --config ${{env.BUILD_TYPE}} --parallel
- name: Upload release artifacts
uses: actions/upload-artifact@v4
with:
name: pico-cec-${{matrix.pico_board}}-${{ github.run_id }}
path: |
${{github.workspace}}/${{matrix.pico_board}}/pico-cec.uf2
if-no-files-found: error
build-stl:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'false'
- name: Install OpenSCAD
shell: bash
run: |
sudo apt install --no-install-recommends -y openscad
- name: Export to STL
run: |
cd ${{github.workspace}}/openscad && make
- name: Upload STL release artifacts
uses: actions/upload-artifact@v4
with:
name: pico-cec-stl-${{ github.run_id }}
path: |
${{github.workspace}}/openscad/*.stl
if-no-files-found: error
success:
runs-on: ubuntu-latest
needs:
- build
- build-stl
steps:
- run: echo "Success!"
release:
needs: success
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') }}
permissions:
contents: write
steps:
- name: Download release artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: false
- name: Generate release hashes
run: |
ls -lR
mv pico-cec-${{env.RELEASE_BOARD}}-${{github.run_id}}/pico-cec.uf2 .
mv pico-cec-stl-${{github.run_id}}/*.stl .
sha256sum pico-cec.uf2 *.stl > sha256sum.txt
- name: Compress release assets
run: |
zip ${{env.RELEASE_ZIP}} pico-cec.uf2 *.stl sha256sum.txt
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
${{env.RELEASE_ZIP}}