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