Skip to content

Split LA channel setup into helper function #488

Split LA channel setup into helper function

Split LA channel setup into helper function #488

Workflow file for this run

name: pslab-firmware
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_call:
jobs:
build:
strategy:
matrix:
target: [v6, v5, v6_esp01]
include:
- target: v6
cmake_flags: '-DCMAKE_BUILD_TYPE=RelWithDebInfo'
- target: v5
cmake_flags: '-DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEGACY_HARDWARE=1'
- target: v6_esp01
cmake_flags: '-DCMAKE_BUILD_TYPE=RelWithDebInfo -DESP01=1'
runs-on: ubuntu-latest
steps:
- name: Download project files
uses: actions/checkout@v4
- name: Cache Compilers
id: cache-compiler
uses: actions/cache@v3
with:
path: ~/.cache/mplab-xc
key: xc16-v2.10-x8-v3.00-cache
- name: Download XC16 Compiler
if: steps.cache-compiler.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.cache/mplab-xc
cd ~/.cache/mplab-xc
wget https://ww1.microchip.com/downloads/aemDocuments/documents/DEV/ProductDocuments/SoftwareTools/xc16-v2.10-full-install-linux64-installer.run
chmod +x xc16-v2.10-full-install-linux64-installer.run
- name: Install XC16 Compiler
run: |
cd ~/.cache/mplab-xc
sudo ./xc16-v2.10-full-install-linux64-installer.run --mode unattended --netservername dontknow
- name: Set up cmake-microchip submodules
run: |
git submodule init
git submodule update
- name: Build firmware
run: |
mkdir build_${{ matrix.target }}
cd build_${{ matrix.target }}
cmake .. ${{ matrix.cmake_flags}}
make
- name: Fetch bootloader
run: |
wget https://github.com/fossasia/pslab-bootloader/releases/latest/download/pslab-bootloader.hex
- name: Download XC8 Compiler
if: steps.cache-compiler.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.cache/mplab-xc
cd ~/.cache/mplab-xc
wget https://ww1.microchip.com/downloads/aemDocuments/documents/DEV/ProductDocuments/SoftwareTools/xc8-v3.00-full-install-linux-x64-installer.run
chmod +x xc8-v3.00-full-install-linux-x64-installer.run
- name: Install XC8 Compiler
run: |
cd ~/.cache/mplab-xc
sudo ./xc8-v3.00-full-install-linux-x64-installer.run --mode unattended --netservername dontknow
echo "/opt/microchip/xc8/v3.00/pic/bin" >> $GITHUB_PATH
- name: Combine hex files
run: |
hexmate r0-2FFF,pslab-bootloader.hex r3000-54FFF,build_${{ matrix.target }}/pslab-firmware.hex r55000-FFFFFFFF,pslab-bootloader.hex -Obuild_${{ matrix.target }}/combined.hex
- name: Publish build files
uses: actions/upload-artifact@v4
with:
name: pslab-firmware_${{ matrix.target}}
path: build_${{ matrix.target }}/combined.hex