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,120 +1,110 @@
name: Test
on:
push:
pull_request:
workflow_dispatch:
jobs:
doc:
runs-on: ubuntu-latest
name: '📓 Docs'
name: "📓 Docs"
steps:
- name: "🧰 Checkout"
uses: actions/checkout@v4
- name: '🧰 Checkout'
uses: actions/checkout@v4
- name: "📓 BuildTheDocs (BTD)"
uses: buildthedocs/btd@v0
with:
token: ${{ github.token }}
skip-deploy: ${{ github.event_name == 'pull_request' }}
- name: '📓 BuildTheDocs (BTD)'
uses: buildthedocs/btd@v0
with:
token: ${{ github.token }}
skip-deploy: ${{ github.event_name == 'pull_request' }}
- name: '🧹 Clean HTML build'
if: ${{ github.event_name != 'pull_request' }}
run: sudo rm -rf doc/_build/html/.git
- name: '📤 Upload artifact: HTML'
uses: actions/upload-artifact@v4
with:
name: openFPGALoader-Documentation
path: doc/_build/html
- name: "🧹 Clean HTML build"
if: ${{ github.event_name != 'pull_request' }}
run: sudo rm -rf doc/_build/html/.git
- name: "📤 Upload artifact: HTML"
uses: actions/upload-artifact@v4
with:
name: openFPGALoader-Documentation
path: doc/_build/html
lin-build:
strategy:
fail-fast: false
matrix:
os:
- 22
- 24
name: '🚧🐧 Ubuntu ${{ matrix.os }} | build'
- 22
- 24
name: "🚧🐧 Ubuntu ${{ matrix.os }} | build"
runs-on: ubuntu-${{ matrix.os }}.04
steps:
- name: "🧰 Checkout"
uses: actions/checkout@v4
- name: '🧰 Checkout'
uses: actions/checkout@v4
- name: "⚙️ Install dependencies"
run: |
sudo apt update -qq
sudo apt install -y \
cmake \
gzip \
libftdi1-2 \
libftdi1-dev \
libhidapi-libusb0 \
libhidapi-dev \
libudev-dev \
pkg-config \
tree \
zlib1g-dev
- name: '⚙️ Install dependencies'
run: |
sudo apt update -qq
sudo apt install -y \
cmake \
gzip \
libftdi1-2 \
libftdi1-dev \
libhidapi-libusb0 \
libhidapi-dev \
libudev-dev \
pkg-config \
tree \
zlib1g-dev
- name: "🚧 Build tarball"
run: |
mkdir build
cd build
cmake ..
cmake --build .
- name: '🚧 Build tarball'
run: |
mkdir build
cd build
cmake ..
cmake --build .
make DESTDIR=$(pwd)/dist install
_rulesdir='dist/etc/udev/rules.d/'
mkdir -p "${_rulesdir}"
cp ../99-openfpgaloader.rules "${_rulesdir}"
_licenses="dist/usr/local/share/licenses/openFPGALoader"
mkdir -p "${_licenses}"
install -m 644 ../LICENSE "${_licenses}"
make DESTDIR=$(pwd)/dist install
_rulesdir='dist/etc/udev/rules.d/'
mkdir -p "${_rulesdir}"
cp ../99-openfpgaloader.rules "${_rulesdir}"
_licenses="dist/usr/local/share/licenses/openFPGALoader"
mkdir -p "${_licenses}"
install -m 644 ../LICENSE "${_licenses}"
tar -cvzf ../ubtuntu${{ matrix.os }}.04-openFPGALoader.tgz -C dist .
tar -cvzf ../ubtuntu${{ matrix.os }}.04-openFPGALoader.tgz -C dist .
- name: '📤 Upload artifact: tarball'
uses: actions/upload-artifact@v4
with:
name: ubtuntu${{ matrix.os }}.04-openFPGALoader
path: ubtuntu${{ matrix.os }}.04-openFPGALoader.tgz
- name: '🔍 Show package content'
run: |
mkdir tmp
cd tmp
tar -xf ../ubtuntu${{ matrix.os }}.04-openFPGALoader.tgz
tree .
- name: "📤 Upload artifact: tarball"
uses: actions/upload-artifact@v4
with:
name: ubtuntu${{ matrix.os }}.04-openFPGALoader
path: ubtuntu${{ matrix.os }}.04-openFPGALoader.tgz
- name: "🔍 Show package content"
run: |
mkdir tmp
cd tmp
tar -xf ../ubtuntu${{ matrix.os }}.04-openFPGALoader.tgz
tree .
mac-build:
strategy:
fail-fast: false
name: '🚧🐧 macOS latest | build'
name: "🚧🐧 macOS latest | build"
runs-on: macos-latest
steps:
- name: "🧰 Checkout"
uses: actions/checkout@v4
- name: '🧰 Checkout'
uses: actions/checkout@v4
- name: '⚙️ Install dependencies'
run: |
#brew update
brew install --only-dependencies openFPGALoader
- name: '🚧 Build tarball'
run: |
mkdir build
cd build
cmake ..
cmake --build .
- name: "⚙️ Install dependencies"
run: |
#brew update
brew install --only-dependencies openFPGALoader
- name: "🚧 Build tarball"
run: |
mkdir build
cd build
cmake ..
cmake --build .
lin-test:
needs: lin-build
@ -122,34 +112,32 @@ jobs:
fail-fast: false
matrix:
os:
- 22
- 24
name: '🚦🐧 Ubuntu ${{ matrix.os }} | test'
- 22
- 24
name: "🚦🐧 Ubuntu ${{ matrix.os }} | test"
runs-on: ubuntu-${{ matrix.os }}.04
steps:
- name: "⚙️ Install dependencies"
run: |
sudo apt update -qq
sudo apt install -y \
libftdi1-2 \
libhidapi-libusb0 \
udev \
zlib1g
- name: '⚙️ Install dependencies'
run: |
sudo apt update -qq
sudo apt install -y \
libftdi1-2 \
libhidapi-libusb0 \
udev \
zlib1g
- name: "📥 Download artifact: package"
uses: actions/download-artifact@v4.1.7
with:
name: ubtuntu${{ matrix.os }}.04-openFPGALoader
- name: '📥 Download artifact: package'
uses: actions/download-artifact@v4.1.7
with:
name: ubtuntu${{ matrix.os }}.04-openFPGALoader
- name: '🛠️ Install package'
run: sudo tar -xvzf *.tgz -C /
- name: '🚦 Test package'
run: |
openFPGALoader --help
openFPGALoader --detect || true
- name: "🛠️ Install package"
run: sudo tar -xvzf *.tgz -C /
- name: "🚦 Test package"
run: |
openFPGALoader --help
openFPGALoader --detect || true
win-jobs:
name: ⬜ Generate list of MSYS2 jobs
@ -157,13 +145,13 @@ jobs:
outputs:
jobs: ${{ steps.matrix.outputs.jobs }}
steps:
- id: matrix
uses: msys2/setup-msys2/matrix@a5d2c5a565c520efa5f477391e4e3f87c2e08f46
with:
systems: >-
mingw64
ucrt64
clang64
- id: matrix
uses: msys2/setup-msys2/matrix@a5d2c5a565c520efa5f477391e4e3f87c2e08f46
with:
systems: >-
mingw64
ucrt64
clang64
win:
needs: win-jobs
@ -178,29 +166,27 @@ jobs:
openFPGALoader --help
openFPGALoader --detect || true
Release:
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
name: '📦 Release'
name: "📦 Release"
steps:
- name: "📥 Download artifacts"
uses: actions/download-artifact@v4.1.7
with:
path: artifact
- name: '📥 Download artifacts'
uses: actions/download-artifact@v4.1.7
with:
path: artifact
- name: "✉️ Package Documentation"
run: |
cd artifact
tar cvzf openFPGALoader-Documentation.tar.gz openFPGALoader-Documentation
rm -rf openFPGALoader-Documentation
- name: '✉️ Package Documentation'
run: |
cd artifact
tar cvzf openFPGALoader-Documentation.tar.gz openFPGALoader-Documentation
rm -rf openFPGALoader-Documentation
# Tagged: create a pre-release or a release (semver)
# Untagged: update the assets of pre-release 'nightly'
- uses: pyTooling/Actions/releaser@r0
with:
token: ${{ github.token }}
tag: 'nightly'
files: artifact/**/*
# Tagged: create a pre-release or a release (semver)
# Untagged: update the assets of pre-release 'nightly'
- uses: pyTooling/Actions/releaser@r0
with:
token: ${{ github.token }}
tag: "nightly"
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).
## 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
`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"]