Skip to content
Merged

Dev #46

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
201 changes: 201 additions & 0 deletions .github/workflows/build-common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
name: Common Build Steps

on:
workflow_call:
inputs:
build-firmware:
description: 'Whether to build firmware'
required: false
type: boolean
default: true
build-configurator:
description: 'Whether to build configurator'
required: false
type: boolean
default: false
artifact-name-suffix:
description: 'Suffix for artifact names'
required: true
type: string
run-windows:
description: 'Whether to run Windows job'
required: false
type: boolean
default: true
run-linux:
description: 'Whether to run Linux job'
required: false
type: boolean
default: true
run-macos:
description: 'Whether to run macOS job'
required: false
type: boolean
default: true

jobs:
windows:
runs-on: windows-latest
if: ${{ inputs.run-windows }}

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pillow

- name: Install ARM GNU Toolchain
run: |
$url = "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v13.2.1-1.1/xpack-arm-none-eabi-gcc-13.2.1-1.1-win32-x64.zip"
$output = "arm-toolchain.zip"
Invoke-WebRequest -Uri $url -OutFile $output
Expand-Archive -Path $output -DestinationPath "C:\arm-toolchain"
echo "C:\arm-toolchain\xpack-arm-none-eabi-gcc-13.2.1-1.1\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Configure CMake (with automatic SDK fetch and patch)
run: |
mkdir build
cd build
cmake -S .. -B . -G Ninja -DPICO_SDK_FETCH_FROM_GIT=ON "-DPICO_SDK_FETCH_FROM_GIT_TAG=2.1.1" "-DPICO_BOARD_HEADER_DIRS=../src/boards" -DPICO_BOARD=pico9918 -DBUILD_TOOLS_FROM_SOURCE=ON

- name: Build Firmware
if: ${{ inputs.build-firmware }}
run: |
cd build
cmake --build . --target firmware

- name: Build Configurator
if: ${{ inputs.build-configurator }}
run: |
cd build
cmake --build . --target configurator_all

- name: Upload Firmware Artifacts
if: ${{ inputs.build-firmware }}
uses: actions/upload-artifact@v4
with:
name: firmware-${{ inputs.artifact-name-suffix }}
path: build/dist/*.uf2

- name: Upload Configurator Artifacts
if: ${{ inputs.build-configurator }}
uses: actions/upload-artifact@v4
with:
name: configurator-${{ inputs.artifact-name-suffix }}
path: |
build/dist/*.rom
build/dist/*.bin
build/dist/*.nabu
build/dist/*.npz

linux:
runs-on: ubuntu-latest
if: ${{ inputs.run-linux }}

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake python3 python3-pip git gcc-arm-none-eabi
pip3 install pillow

- name: Configure CMake (with automatic SDK fetch and patch)
run: |
mkdir build
cd build
cmake -S .. -B . -G Ninja -DPICO_SDK_FETCH_FROM_GIT=ON "-DPICO_SDK_FETCH_FROM_GIT_TAG=2.1.1" "-DPICO_BOARD_HEADER_DIRS=../src/boards" -DPICO_BOARD=pico9918 -DBUILD_TOOLS_FROM_SOURCE=ON

- name: Build Firmware
if: ${{ inputs.build-firmware }}
run: |
cd build
cmake --build . --target firmware

- name: Build Configurator
if: ${{ inputs.build-configurator }}
run: |
cd build
cmake --build . --target configurator_all

- name: Upload Firmware Artifacts
if: ${{ inputs.build-firmware }}
uses: actions/upload-artifact@v4
with:
name: firmware-${{ inputs.artifact-name-suffix }}
path: build/dist/*.uf2

- name: Upload Configurator Artifacts
if: ${{ inputs.build-configurator }}
uses: actions/upload-artifact@v4
with:
name: configurator-${{ inputs.artifact-name-suffix }}
path: |
build/dist/*.rom
build/dist/*.bin
build/dist/*.nabu
build/dist/*.npz

macos:
runs-on: macos-latest
if: ${{ inputs.run-macos }}

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
run: |
brew install cmake ninja python3 git
pip3 install pillow --break-system-packages

- name: Install ARM GNU Toolchain
run: |
# Use the same version as other platforms for consistency
curl -L "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v13.2.1-1.1/xpack-arm-none-eabi-gcc-13.2.1-1.1-darwin-arm64.tar.gz" -o arm-toolchain.tar.gz
sudo tar -xzf arm-toolchain.tar.gz -C /opt
echo "/opt/xpack-arm-none-eabi-gcc-13.2.1-1.1/bin" >> $GITHUB_PATH

- name: Configure CMake (with automatic SDK fetch and patch)
run: |
mkdir build
cd build
cmake -S .. -B . -G Ninja -DPICO_SDK_FETCH_FROM_GIT=ON "-DPICO_SDK_FETCH_FROM_GIT_TAG=2.1.1" "-DPICO_BOARD_HEADER_DIRS=../src/boards" -DPICO_BOARD=pico9918 -DBUILD_TOOLS_FROM_SOURCE=ON

- name: Build Firmware
if: ${{ inputs.build-firmware }}
run: |
cd build
cmake --build . --target firmware

- name: Build Configurator
if: ${{ inputs.build-configurator }}
run: |
cd build
cmake --build . --target configurator_all

- name: Upload Firmware Artifacts
if: ${{ inputs.build-firmware }}
uses: actions/upload-artifact@v4
with:
name: firmware-${{ inputs.artifact-name-suffix }}
path: build/dist/*.uf2

- name: Upload Configurator Artifacts
if: ${{ inputs.build-configurator }}
uses: actions/upload-artifact@v4
with:
name: configurator-${{ inputs.artifact-name-suffix }}
path: |
build/dist/*.rom
build/dist/*.bin
build/dist/*.nabu
build/dist/*.npz
19 changes: 19 additions & 0 deletions .github/workflows/configurator-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Configurator Linux

on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]
workflow_dispatch:

jobs:
build:
uses: ./.github/workflows/build-common.yml
with:
build-firmware: true
build-configurator: true
artifact-name-suffix: linux
run-windows: false
run-linux: true
run-macos: false
19 changes: 19 additions & 0 deletions .github/workflows/configurator-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Configurator macOS

on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]
workflow_dispatch:

jobs:
build:
uses: ./.github/workflows/build-common.yml
with:
build-firmware: true
build-configurator: true
artifact-name-suffix: macos
run-windows: false
run-linux: false
run-macos: true
19 changes: 19 additions & 0 deletions .github/workflows/configurator-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Configurator Windows

on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]
workflow_dispatch:

jobs:
build:
uses: ./.github/workflows/build-common.yml
with:
build-firmware: true
build-configurator: true
artifact-name-suffix: windows
run-windows: true
run-linux: false
run-macos: false
120 changes: 0 additions & 120 deletions .github/workflows/configurator.yml

This file was deleted.

Loading
Loading