wip pixi build

This commit is contained in:
Tom Karolyshyn 2025-12-19 15:34:38 -05:00
parent 63a42344bc
commit 4d3460eede
5 changed files with 3755 additions and 133 deletions

View File

@ -1,38 +1,32 @@
name: Test name: Test
on: on:
push:
pull_request:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
doc: doc:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: '📓 Docs' name: "📓 Docs"
steps: steps:
- name: "🧰 Checkout"
- name: '🧰 Checkout'
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: '📓 BuildTheDocs (BTD)' - name: "📓 BuildTheDocs (BTD)"
uses: buildthedocs/btd@v0 uses: buildthedocs/btd@v0
with: with:
token: ${{ github.token }} token: ${{ github.token }}
skip-deploy: ${{ github.event_name == 'pull_request' }} skip-deploy: ${{ github.event_name == 'pull_request' }}
- name: '🧹 Clean HTML build' - name: "🧹 Clean HTML build"
if: ${{ github.event_name != 'pull_request' }} if: ${{ github.event_name != 'pull_request' }}
run: sudo rm -rf doc/_build/html/.git run: sudo rm -rf doc/_build/html/.git
- name: '📤 Upload artifact: HTML' - name: "📤 Upload artifact: HTML"
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: openFPGALoader-Documentation name: openFPGALoader-Documentation
path: doc/_build/html path: doc/_build/html
lin-build: lin-build:
strategy: strategy:
fail-fast: false fail-fast: false
@ -40,14 +34,13 @@ jobs:
os: os:
- 22 - 22
- 24 - 24
name: '🚧🐧 Ubuntu ${{ matrix.os }} | build' name: "🚧🐧 Ubuntu ${{ matrix.os }} | build"
runs-on: ubuntu-${{ matrix.os }}.04 runs-on: ubuntu-${{ matrix.os }}.04
steps: steps:
- name: "🧰 Checkout"
- name: '🧰 Checkout'
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: '⚙️ Install dependencies' - name: "⚙️ Install dependencies"
run: | run: |
sudo apt update -qq sudo apt update -qq
sudo apt install -y \ sudo apt install -y \
@ -62,7 +55,7 @@ jobs:
tree \ tree \
zlib1g-dev zlib1g-dev
- name: '🚧 Build tarball' - name: "🚧 Build tarball"
run: | run: |
mkdir build mkdir build
cd build cd build
@ -79,43 +72,40 @@ jobs:
tar -cvzf ../ubtuntu${{ matrix.os }}.04-openFPGALoader.tgz -C dist . tar -cvzf ../ubtuntu${{ matrix.os }}.04-openFPGALoader.tgz -C dist .
- name: '📤 Upload artifact: tarball' - name: "📤 Upload artifact: tarball"
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: ubtuntu${{ matrix.os }}.04-openFPGALoader name: ubtuntu${{ matrix.os }}.04-openFPGALoader
path: ubtuntu${{ matrix.os }}.04-openFPGALoader.tgz path: ubtuntu${{ matrix.os }}.04-openFPGALoader.tgz
- name: '🔍 Show package content' - name: "🔍 Show package content"
run: | run: |
mkdir tmp mkdir tmp
cd tmp cd tmp
tar -xf ../ubtuntu${{ matrix.os }}.04-openFPGALoader.tgz tar -xf ../ubtuntu${{ matrix.os }}.04-openFPGALoader.tgz
tree . tree .
mac-build: mac-build:
strategy: strategy:
fail-fast: false fail-fast: false
name: '🚧🐧 macOS latest | build' name: "🚧🐧 macOS latest | build"
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- name: "🧰 Checkout"
- name: '🧰 Checkout'
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: '⚙️ Install dependencies' - name: "⚙️ Install dependencies"
run: | run: |
#brew update #brew update
brew install --only-dependencies openFPGALoader brew install --only-dependencies openFPGALoader
- name: '🚧 Build tarball' - name: "🚧 Build tarball"
run: | run: |
mkdir build mkdir build
cd build cd build
cmake .. cmake ..
cmake --build . cmake --build .
lin-test: lin-test:
needs: lin-build needs: lin-build
strategy: strategy:
@ -124,11 +114,10 @@ jobs:
os: os:
- 22 - 22
- 24 - 24
name: '🚦🐧 Ubuntu ${{ matrix.os }} | test' name: "🚦🐧 Ubuntu ${{ matrix.os }} | test"
runs-on: ubuntu-${{ matrix.os }}.04 runs-on: ubuntu-${{ matrix.os }}.04
steps: steps:
- name: "⚙️ Install dependencies"
- name: '⚙️ Install dependencies'
run: | run: |
sudo apt update -qq sudo apt update -qq
sudo apt install -y \ sudo apt install -y \
@ -137,20 +126,19 @@ jobs:
udev \ udev \
zlib1g zlib1g
- name: '📥 Download artifact: package' - name: "📥 Download artifact: package"
uses: actions/download-artifact@v4.1.7 uses: actions/download-artifact@v4.1.7
with: with:
name: ubtuntu${{ matrix.os }}.04-openFPGALoader name: ubtuntu${{ matrix.os }}.04-openFPGALoader
- name: '🛠️ Install package' - name: "🛠️ Install package"
run: sudo tar -xvzf *.tgz -C / run: sudo tar -xvzf *.tgz -C /
- name: '🚦 Test package' - name: "🚦 Test package"
run: | run: |
openFPGALoader --help openFPGALoader --help
openFPGALoader --detect || true openFPGALoader --detect || true
win-jobs: win-jobs:
name: ⬜ Generate list of MSYS2 jobs name: ⬜ Generate list of MSYS2 jobs
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -178,20 +166,18 @@ jobs:
openFPGALoader --help openFPGALoader --help
openFPGALoader --detect || true openFPGALoader --detect || true
Release: Release:
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/')) if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/'))
needs: [ lin-test, win ] needs: [lin-test, win]
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: '📦 Release' name: "📦 Release"
steps: steps:
- name: "📥 Download artifacts"
- name: '📥 Download artifacts'
uses: actions/download-artifact@v4.1.7 uses: actions/download-artifact@v4.1.7
with: with:
path: artifact path: artifact
- name: '✉️ Package Documentation' - name: "✉️ Package Documentation"
run: | run: |
cd artifact cd artifact
tar cvzf openFPGALoader-Documentation.tar.gz openFPGALoader-Documentation tar cvzf openFPGALoader-Documentation.tar.gz openFPGALoader-Documentation
@ -202,5 +188,5 @@ jobs:
- uses: pyTooling/Actions/releaser@r0 - uses: pyTooling/Actions/releaser@r0
with: with:
token: ${{ github.token }} token: ${{ github.token }}
tag: 'nightly' tag: "nightly"
files: artifact/**/* files: artifact/**/*

39
.github/workflows/pixi-build.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Pixi Build
on:
workflow_dispatch:
jobs:
pixi-build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-14 # Apple Silicon
include:
- os: ubuntu-latest
platform: linux-64
- os: macos-14
platform: osx-arm64
name: "🚧 Pixi ${{ matrix.os }} | build"
runs-on: ${{ matrix.os }}
steps:
- name: "🧰 Checkout"
uses: actions/checkout@v4
- name: "⚙️ Setup Pixi"
uses: prefix-dev/setup-pixi@v0.9.3
with:
pixi-version: v0.62.1
cache: true
- name: "🚧 Build with Pixi"
run: pixi run build
- name: "🚦 Test with Pixi"
run: |
pixi run test
pixi run list-boards | head -20
pixi run list-cables | head -20
pixi run list-fpga | head -20

View File

@ -31,6 +31,53 @@ Also checkout the vendor-specific documentation:
OpenFPGALoader has a dedicated channel: [#openFPGALoader at libera.chat](https://web.libera.chat/#openFPGALoader). OpenFPGALoader has a dedicated channel: [#openFPGALoader at libera.chat](https://web.libera.chat/#openFPGALoader).
## Building with Pixi
This project supports [Pixi](https://pixi.sh) for cross-platform dependency management and building.
### Prerequisites
Install Pixi from https://pixi.sh
### Quick Start
```bash
# Install dependencies
pixi install
# Build the project
pixi run build
# Run tests
pixi run test
# List all available tasks
pixi task list
```
### Available Tasks
- `pixi run configure` - Configure the build with CMake
- `pixi run build` - Build the project (runs configure automatically)
- `pixi run test` - Run help command to verify build
- `pixi run clean` - Clean build artifacts
- `pixi run all` - Build and test
- `pixi run rebuild` - Clean and build from scratch
- `pixi run list-boards` - List all supported boards
- `pixi run list-cables` - List all supported cables
- `pixi run list-fpga` - List all supported FPGAs
### Optional Features
```bash
# Use dev environment with debugging tools (gdb, valgrind on Linux)
pixi shell -e dev
# Use libgpiod environment (Linux only)
pixi shell -e gpiod
pixi run build-with-gpiod
```
## Quick Usage ## Quick Usage
`arty` in the example below is one of the many FPGA board configurations listed [here](https://trabucayre.github.io/openFPGALoader/compatibility/board.html). `arty` in the example below is one of the many FPGA board configurations listed [here](https://trabucayre.github.io/openFPGALoader/compatibility/board.html).

3475
pixi.lock Normal file

File diff suppressed because it is too large Load Diff

75
pixi.toml Normal file
View File

@ -0,0 +1,75 @@
[workspace]
name = "openFPGALoader"
version = "1.0.0"
description = "Universal utility for programming FPGAs"
authors = ["Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>"]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-arm64"]
[dependencies]
cmake = ">=3.5"
cxx-compiler = "*"
pkg-config = "*"
libftdi = "*"
libusb = ">=1.0"
zlib = "*"
libhidapi = "*"
[target.linux-64.dependencies]
libudev = "*"
gzip = "*"
[target.osx-arm64.dependencies]
gzip = "*"
[tasks]
# Configuration tasks
configure = "cmake -B build -DCMAKE_BUILD_TYPE=Release"
configure-debug = "cmake -B build -DCMAKE_BUILD_TYPE=Debug"
# Build tasks
build = { cmd = "cmake --build build", depends-on = ["configure"] }
build-verbose = { cmd = "cmake --build build --verbose", depends-on = ["configure"] }
# Clean task
clean = "rm -rf build"
# Install task (requires sudo on Linux, installs to system directories)
install = { cmd = "cmake --build build --target install", depends-on = ["build"] }
# Test/run tasks
test = { cmd = "./build/openFPGALoader --help", depends-on = ["build"] }
detect = { cmd = "./build/openFPGALoader --detect || true", depends-on = ["build"] }
list-boards = { cmd = "./build/openFPGALoader --list-boards", depends-on = ["build"] }
list-cables = { cmd = "./build/openFPGALoader --list-cables", depends-on = ["build"] }
list-fpga = { cmd = "./build/openFPGALoader --list-fpga", depends-on = ["build"] }
# Combined tasks
all = { depends-on = ["build", "test"] }
rebuild = { depends-on = ["clean", "build"] }
[feature.dev.dependencies]
[feature.dev.target.linux-64.dependencies]
gdb = "*"
valgrind = "*"
[feature.dev.target.osx-64.dependencies]
gdb = "*"
[feature.dev.target.osx-arm64.dependencies]
gdb = "*"
[feature.dev.tasks]
debug-build = { cmd = "cmake --build build", depends-on = ["configure-debug"] }
[feature.libgpiod.target.linux-64.dependencies]
libgpiod = ">=1.0"
[feature.libgpiod.tasks]
configure-with-gpiod = "cmake -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_LIBGPIOD=ON"
build-with-gpiod = { cmd = "cmake --build build", depends-on = ["configure-with-gpiod"] }
[environments]
dev = ["dev"]
gpiod = ["libgpiod"]