Files
cuframes/.gitea/workflows/build.yml
T
gx d2bae7d0fd
build / cmake build (CUDA 12.4, Ubuntu 22.04) (push) Successful in 1m57s
build / ffmpeg filter patch (out-of-tree) (push) Successful in 3m36s
ci: clone ffmpeg-patched через GITHUB_SERVER_URL (для VPN-runner'а)
Жёсткий URL git.goldix.org не работает на u4-runner — там
gitea доступен только через VPN (10.8.0.6:3222). Используем
переменную runner'а — на R9 = 192.168.88.23:3222, на u4 = 10.8.0.6:3222.
2026-05-19 02:55:14 +01:00

146 lines
5.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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:
# actions/checkout@v4 требует Node 20+. Ubuntu 22.04 apt даёт Node 12 — не подходит.
# Ставим Node 20 из NodeSource repo.
- name: Bootstrap Node 20 + git (для actions/checkout)
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends curl git ca-certificates gnupg
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y --no-install-recommends nodejs
node --version
- name: Install build deps
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get install -y --no-install-recommends \
build-essential cmake ninja-build pkg-config \
libavformat-dev libavcodec-dev libavutil-dev libswscale-dev
- 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: Bootstrap Node 20 + git (для actions/checkout)
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends curl git ca-certificates gnupg
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y --no-install-recommends nodejs
node --version
- name: Install build deps
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get install -y --no-install-recommends \
build-essential cmake ninja-build pkg-config nasm \
libssl-dev libx264-dev libx265-dev libnuma-dev zlib1g-dev \
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
# Clone уже-patched FFmpeg fork с локального gitea (быстро + offline).
# Используем ${GITHUB_SERVER_URL} — runner подставит свой view на gitea:
# на R9-runner = http://192.168.88.23:3222, на u4-runner = http://10.8.0.6:3222 (VPN).
# Hardcoded https://git.goldix.org/... не работает на u4 — нет route к public IP.
- name: Clone patched FFmpeg fork (local gitea mirror)
run: |
git clone --depth 1 --branch n7.1-cuframes \
"${GITHUB_SERVER_URL}/gx/ffmpeg-patched.git" /src/ffmpeg
ls /src/ffmpeg/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