ci: gitea Actions workflows (build, release) + README badges
build / cmake build (CUDA 12.4, Ubuntu 22.04) (push) Failing after 1m4s
build / ffmpeg filter patch (out-of-tree) (push) Has been skipped

- .gitea/workflows/build.yml — on push/PR:
    * cmake build на CUDA 12.4 devel image (Ubuntu 22.04 base)
    * compile-only smoke (no GPU нужен): libcuframes.so + tools + examples
    * install-prefix layout verify (headers + libs в правильных путях)
    * filter/ — clone FFmpeg n7.1 + apply patch + build minimal patched
      ffmpeg, verify cuframes demuxer registered

- .gitea/workflows/release.yml — on tag v*:
    * build runtime Docker image, push в git.goldix.org/gx/cuframes:<version>
    * build source tarball cuframes-<version>.tar.gz как artifact

- README.md badges: build status, release version, license

Runner: gitea act_runner v0.4.1 на R9-88.23 — labels ubuntu-22.04 / ubuntu-24.04
доступны через docker.gitea.com/runner-images. CUDA devel image использует
nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04 (уже cached на runner host).

Stress test (требует GPU) намерено НЕ в CI — runner без GPU. Запускать
отдельно на dev-машине через ctest.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 21:43:55 +01:00
parent 12708618d4
commit 4a6a6f4a6c
3 changed files with 211 additions and 3 deletions
+125
View File
@@ -0,0 +1,125 @@
name: build
on:
push:
branches: [main]
paths-ignore:
- '**.md'
- 'docs/**'
- 'BENCHMARKS.md'
- 'ROADMAP.md'
- 'CHANGELOG.md'
- 'LICENSE'
- '.gitea/ISSUE_TEMPLATE/**'
pull_request:
branches: [main]
jobs:
cmake-build:
name: cmake build (CUDA 12.4, Ubuntu 22.04)
runs-on: ubuntu-22.04
container:
image: nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04
steps:
- name: Install build deps
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends \
build-essential cmake ninja-build pkg-config git \
libavformat-dev libavcodec-dev libavutil-dev libswscale-dev \
ca-certificates
- name: Checkout
uses: actions/checkout@v4
- name: Configure (full — libcuframes + examples + tools)
run: |
cmake -B build -S . -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=OFF \
-DBUILD_EXAMPLES=ON \
-DBUILD_TOOLS=ON \
-DBUILD_FFMPEG_FILTER=OFF \
-DBUILD_PYTHON_BINDINGS=OFF
- name: Build
run: cmake --build build --parallel
- name: Verify produced binaries + library
run: |
ls -la build/libcuframes/libcuframes.so*
ls -la build/libcuframes/libcuframes_static.a
ls -la build/tools/cuframes-rtsp-source/cuframes-rtsp-source
ls -la build/examples/sub_count/sub_count
./build/tools/cuframes-rtsp-source/cuframes-rtsp-source --help | head -5
- name: Install + verify install layout
run: |
cmake --install build --prefix /tmp/cuframes-install
test -f /tmp/cuframes-install/include/cuframes/cuframes.h
test -f /tmp/cuframes-install/include/cuframes/cuframes.hpp
test -f /tmp/cuframes-install/lib/libcuframes.so
test -f /tmp/cuframes-install/lib/libcuframes_static.a
filter-build:
name: ffmpeg filter patch (out-of-tree)
runs-on: ubuntu-22.04
container:
image: nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04
needs: cmake-build
steps:
- name: Install build deps
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends \
build-essential cmake ninja-build pkg-config git nasm \
libssl-dev libx264-dev libx265-dev libnuma-dev zlib1g-dev \
ca-certificates wget patch
- name: Checkout
uses: actions/checkout@v4
- name: Build libcuframes (для linking в patched ffmpeg)
run: |
cmake -B build -S . -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TOOLS=OFF
cmake --build build --parallel
cmake --install build --prefix /opt/cuframes
- name: Clone FFmpeg n7.1 + apply patch
run: |
git clone --depth 1 --branch n7.1 https://github.com/FFmpeg/FFmpeg.git /src/ffmpeg
cd /src/ffmpeg
patch -p1 < $GITHUB_WORKSPACE/filter/ffmpeg-7.1-cuframes-demuxer.patch
ls libavformat/cuframesdec.c
- name: Configure FFmpeg (minimal + libcuframes)
run: |
cd /src/ffmpeg
./configure \
--prefix=/opt/ffmpeg \
--enable-libcuframes \
--extra-cflags="-I/opt/cuframes/include -I/usr/local/cuda/include" \
--extra-ldflags="-L/opt/cuframes/lib -L/usr/local/cuda/lib64" \
--extra-libs="-lcudart -lpthread -lrt -lm" \
--disable-x86asm --disable-everything \
--enable-demuxer=cuframes,rawvideo \
--enable-decoder=rawvideo \
--enable-muxer=null,rawvideo \
--enable-protocol=file --enable-ffmpeg \
--disable-doc --disable-htmlpages --disable-manpages \
--disable-podpages --disable-txtpages
- name: Build FFmpeg
run: |
cd /src/ffmpeg
make -j$(nproc) ffmpeg
- name: Verify cuframes demuxer registered
run: |
export LD_LIBRARY_PATH=/opt/cuframes/lib
/src/ffmpeg/ffmpeg -hide_banner -formats | grep cuframes
/src/ffmpeg/ffmpeg -hide_banner -h demuxer=cuframes | head -10
+78
View File
@@ -0,0 +1,78 @@
name: release
# Триггер: push tag v* (e.g. v0.1.0, v0.2.0).
# Сборка: runtime Docker image + source tarball, прикладываем к gitea release.
on:
push:
tags:
- 'v*'
jobs:
docker-runtime:
name: build runtime Docker image
runs-on: ubuntu-22.04
container:
image: docker.gitea.com/runner-images:ubuntu-22.04
# docker socket нужен — gitea runner монтирует /var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Tag from ref
id: tag
run: |
TAG="${GITHUB_REF#refs/tags/v}"
echo "version=$TAG" >> $GITHUB_OUTPUT
- name: Login to gitea registry
run: |
echo "${{ secrets.GITEA_TOKEN }}" | docker login git.goldix.org \
-u "${{ github.actor }}" --password-stdin
- name: Build runtime image
run: |
docker build -f docker/Dockerfile.runtime \
-t git.goldix.org/gx/cuframes:${{ steps.tag.outputs.version }} \
-t git.goldix.org/gx/cuframes:latest \
.
- name: Push
run: |
docker push git.goldix.org/gx/cuframes:${{ steps.tag.outputs.version }}
docker push git.goldix.org/gx/cuframes:latest
source-tarball:
name: build source tarball
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Tag from ref
id: tag
run: |
TAG="${GITHUB_REF#refs/tags/v}"
echo "version=$TAG" >> $GITHUB_OUTPUT
- name: Create tarball
run: |
VERSION="${{ steps.tag.outputs.version }}"
mkdir -p /tmp/release
git archive --format=tar.gz --prefix="cuframes-$VERSION/" \
-o "/tmp/release/cuframes-$VERSION.tar.gz" HEAD
ls -la /tmp/release/
# Готовый artifact — пользователь скачает с release page либо attached к release.
# Gitea release upload через API делается отдельным шагом (см. gitea/release-action
# либо curl); тут оставляем артефакт как build output для последующего ручного
# attach. Для полной автоматизации — добавить шаг upload через curl + GITEA_TOKEN.
- name: Upload tarball as artifact
uses: actions/upload-artifact@v3
with:
name: cuframes-${{ steps.tag.outputs.version }}-source
path: /tmp/release/cuframes-*.tar.gz
+8 -3
View File
@@ -1,10 +1,15 @@
# cuframes
[![build](https://git.goldix.org/gx/cuframes/actions/workflows/build.yml/badge.svg?branch=main)](https://git.goldix.org/gx/cuframes/actions?workflow=build.yml)
[![release](https://img.shields.io/badge/release-v0.1.0-blue)](https://git.goldix.org/gx/cuframes/releases/tag/v0.1.0)
[![license](https://img.shields.io/badge/license-LGPL--2.1+-green)](LICENSE)
Zero-copy sharing декодированных видеокадров между процессами через CUDA IPC.
**Статус:** v0.1 — libcuframes готов, cuframes-rtsp-source готов, e2e-pipeline
протестирован (4×subscriber × 2000 frames, 0 torn). FFmpeg filter — v0.2.
**Лицензия:** LGPL-2.1+
**Статус:** v0.1.0 released — production-deployed на multi-camera CCTV-стeке
(Frigate + custom C++ processor, оба используют один publisher на одном NVDEC).
См. [BENCHMARKS.md](BENCHMARKS.md) для measurements, [ROADMAP.md](ROADMAP.md)
для v0.2 plans.
## Минимальные требования