feat: add minimal AI processing support #218
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| ci-linux: | |
| runs-on: ubuntu-22.04 | |
| concurrency: | |
| group: "build-linux-${{ github.event.pull_request.number }}" | |
| cancel-in-progress: true | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake pkg-config | |
| sudo apt-get install -y nasm yasm libx264-dev libx265-dev libnuma-dev | |
| git clone https://github.com/google/googletest.git 3rd_party/gtest | |
| - name: Get FFmpeg | |
| run: | | |
| wget https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2024-11-30-13-12/ffmpeg-n5.1.6-11-gcde3c5fc0c-linux64-gpl-shared-5.1.tar.xz | |
| tar xJvf ffmpeg-n5.1.6-11-gcde3c5fc0c-linux64-gpl-shared-5.1.tar.xz | |
| ls ffmpeg-n5.1.6-11-gcde3c5fc0c-linux64-gpl-shared-5.1 | |
| echo "FFMPEG_ROOT_PATH=$(pwd)/ffmpeg-n5.1.6-11-gcde3c5fc0c-linux64-gpl-shared-5.1" >> $GITHUB_ENV | |
| - name: Build with CMake | |
| run: | | |
| export PATH=$PATH:$FFMPEG_ROOT_PATH/bin | |
| (cd src && cmake -B build -DENABLE_TESTS=ON -DBMF_TRANSCODER=OFF -DENABLE_GUI=OFF && cd build && make -j$(nproc)) | |
| - name: Run tests | |
| run: | | |
| export LD_LIBRARY_PATH=$FFMPEG_ROOT_PATH/lib | |
| wget https://github.com/JackLau1222/OpenConverter/releases/download/files/oc-test.zip | |
| unzip -j oc-test.zip -d src/build/tests/media | |
| cd src/build/tests && ./transcoder_test | |
| ci-macos: | |
| runs-on: macos-latest | |
| concurrency: | |
| group: "build-macos-${{ github.event.pull_request.number }}" | |
| cancel-in-progress: true | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - name: Install dependencies | |
| run: | | |
| brew install cmake pkg-config | |
| brew install nasm yasm x264 x265 | |
| git clone https://github.com/google/googletest.git 3rd_party/gtest | |
| - name: Install FFmpeg via Homebrew | |
| run: | | |
| # Install FFmpeg 5 with x264, x265 support (pre-built from Homebrew) | |
| brew install ffmpeg@5 | |
| # Set FFmpeg path | |
| export FFMPEG_ROOT_PATH=$(brew --prefix ffmpeg@5) | |
| echo "FFMPEG_ROOT_PATH=$FFMPEG_ROOT_PATH" >> $GITHUB_ENV | |
| # Verify FFmpeg has x264 and x265 | |
| echo "FFmpeg configuration:" | |
| $FFMPEG_ROOT_PATH/bin/ffmpeg -version | head -n 1 | |
| $FFMPEG_ROOT_PATH/bin/ffmpeg -encoders 2>/dev/null | grep -E "libx264|libx265" || echo "Warning: x264/x265 not found" | |
| - name: Checkout BMF repository(specific branch) | |
| run: | | |
| git clone https://github.com/OpenConverterLab/bmf.git | |
| cd bmf | |
| git checkout oc | |
| # wget https://invisible-island.net/archives/ncurses/ncurses-6.5.tar.gz | |
| # wget https://ftp.gnu.org/gnu/binutils/binutils-2.43.1.tar.bz2 | |
| - name: Cache BMF build | |
| uses: actions/cache@v3 | |
| with: | |
| path: bmf/output/ | |
| key: ${{ runner.os }}-bmf-${{ hashFiles('bmf/build_osx.sh') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bmf-macos-arm- | |
| - name: Set up BMF if not cached | |
| run: | | |
| if [ ! -d "$(pwd)/bmf/output/" ]; then | |
| # export LIBRARY_PATH=$(pwd)/opt/binutils/lib:$LIBRARY_PATH | |
| # export CMAKE_PREFIX_PATH=$(pwd)/opt/binutils:$CMAKE_PREFIX_PATH | |
| pip install setuptools | |
| (cd bmf && git checkout oc && git submodule update --init --recursive && ./build_osx.sh) | |
| else | |
| echo "BMF is already installed, skipping build." | |
| fi | |
| echo "BMF_ROOT_PATH=$(pwd)/bmf/output/bmf" >> $GITHUB_ENV | |
| - name: Build with CMake | |
| run: | | |
| export PATH=$PATH:$FFMPEG_ROOT_PATH/bin | |
| (cd src && cmake -B build -DENABLE_TESTS=ON -DENABLE_GUI=OFF && cd build && make -j$(sysctl -n hw.ncpu)) | |
| - name: Run tests | |
| run: | | |
| export DYLD_LIBRARY_PATH=$FFMPEG_ROOT_PATH/lib | |
| wget https://github.com/JackLau1222/OpenConverter/releases/download/files/oc-test.zip | |
| unzip -j oc-test.zip -d src/build/tests/media | |
| cd src/build/tests && ./transcoder_test |