feat: a scene reports where it came from — every input's line, and ev… #314
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 Build | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| branches-ignore: | |
| - 'ga-ignore-**' | |
| push: | |
| branches-ignore: | |
| - 'ga-ignore-**' | |
| jobs: | |
| python-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repository | |
| uses: actions/checkout@v4 | |
| - name: Install Python dependencies | |
| run: pip install -r requirements.txt | |
| - name: Install LaTeX (MathTex/Tex) | |
| run: sudo apt-get update && sudo apt-get install -y texlive-latex-base texlive-latex-extra texlive-fonts-recommended dvisvgm | |
| - name: Run Python unit tests | |
| run: ./test/run_tests.sh | |
| - name: Type-check Python API | |
| run: python3 -m pyright | |
| # Does anything public land here undocumented or untested? Reads the | |
| # pushed range, so it sees the same additions a reviewer would. | |
| # Deliberate exception: say why in the commit message and this is the | |
| # one job to override. | |
| - name: Documentation and test coverage of new public API | |
| run: python3 test/coverage_check.py --pushed | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repository | |
| uses: actions/checkout@v4 | |
| - name: Set up VCPKG_ROOT | |
| run: echo "VCPKG_ROOT=$HOME/vcpkg" >> $GITHUB_ENV | |
| - name: Install dependencies | |
| # pkg-config + libxcb1-dev: required by the Linux XCB-surface branch in | |
| # CMakeLists.txt (pkg_check_modules(XCB REQUIRED xcb)) — don't rely on | |
| # them shipping preinstalled on the runner image. | |
| run: sudo apt-get update && sudo apt-get install -y build-essential cmake pkg-config python3-dev ffmpeg libopencv-dev libcurl4-openssl-dev libvulkan-dev libfreetype6-dev glslang-dev glslang-tools g++-13 gcc-13 mesa-vulkan-drivers libxcb1-dev texlive-latex-base texlive-latex-extra texlive-fonts-recommended dvisvgm | |
| - name: Install Python dependencies | |
| run: pip install pybind11 -r requirements.txt | |
| - name: Set CXX environment variable | |
| run: | | |
| g++-13 --version | |
| g++ --version | |
| echo "CXX=$(which g++-13)" >> $GITHUB_ENV | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: '6.2.4' | |
| host: 'linux' | |
| target: 'desktop' | |
| arch: 'gcc_64' | |
| - name: Configure CMake | |
| run: cmake -S . -B build -DCMAKE_CXX_COMPILER=$(which g++-13) -DCI_BUILD=ON | |
| - name: Build the project | |
| run: make -C build | |
| - name: copy executable | |
| run: cp build/video-code video-code | |
| # eg.py is the living showcase — every feature worth seeing, in one scene. | |
| # If it stops rendering, an example in the docs has gone stale. | |
| - name: Render the example scene | |
| run: ./video-code --file eg.py --generate eg.mp4 | |
| - name: Run video-code | |
| run: | | |
| ./video-code --generate out.mp4 | |
| if [ $? -ne 0 ] || [ ! -f "out.mp4" ]; then | |
| echo "Error: video-code failed to generate out.mp4." | |
| exit 1 | |
| fi | |
| mkdir -p video | |
| mv out.mp4 video/video_result.mp4 | |
| # - name: Run functional tests | |
| # run: | | |
| # ./tests/functional_tests.sh | |
| # if [ $? -ne 0 ]; then | |
| # echo "Error: Functional tests failed." | |
| # exit 1 | |
| build-windows: | |
| if: false | |
| runs-on: windows-latest | |
| timeout-minutes: 180 | |
| defaults: | |
| run: | |
| shell: msys2 {0} | |
| steps: | |
| - name: Checkout the repository | |
| uses: actions/checkout@v4 | |
| # MINGW64 (GCC 13+) matches the GNU-style flags (-Wall -Wextra -pipe ...) | |
| # and the `CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13` check in | |
| # CMakeLists.txt — an MSVC/clang-cl toolchain would need those flags | |
| # translated separately. | |
| - name: Set up MSYS2 (MinGW64) | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MINGW64 | |
| update: true | |
| install: >- | |
| mingw-w64-x86_64-toolchain | |
| mingw-w64-x86_64-cmake | |
| mingw-w64-x86_64-ninja | |
| mingw-w64-x86_64-python | |
| mingw-w64-x86_64-python-pip | |
| - name: Install pybind11 | |
| run: python -m pip install pybind11 | |
| # vcpkg builds OpenCV/Qt/FFmpeg/etc. from source for x64-mingw-dynamic — | |
| # very slow on a cold cache. Cache via GitHub Actions so repeat runs reuse | |
| # built packages (see https://learn.microsoft.com/vcpkg/users/binarycaching). | |
| - name: Export GitHub Actions cache environment variables (vcpkg binary cache) | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
| core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
| # CMakeLists.txt sets CMAKE_TOOLCHAIN_FILE *after* project(), which is too | |
| # late for vcpkg to hook in (must be passed on the command line, same as | |
| # the local Makefile's VCPKG_FLAGS). | |
| - name: Configure CMake | |
| env: | |
| VCPKG_ROOT: C:/vcpkg | |
| VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
| # By default vcpkg builds host-tool dependencies (e.g. protoc, needed | |
| # by protobuf) for the x64-windows host triplet using MSVC's rc.exe. | |
| # The MSYS2-provided cmake's Ninja generator emits a broken RC rule | |
| # for MSVC (injects "Note: including file: " into the rc.exe command | |
| # line) -> "fatal error RC1107: invalid usage". Setting the host | |
| # triplet to x64-mingw-dynamic too makes vcpkg build protoc with | |
| # MinGW g++/windres instead, avoiding rc.exe entirely. | |
| MSYS2_ARG_CONV_EXCL: "*" | |
| run: cmake -S . -B build -G Ninja -DCI_BUILD=ON -DVCPKG_TARGET_TRIPLET=x64-mingw-dynamic -DVCPKG_HOST_TRIPLET=x64-mingw-dynamic -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake | |
| - name: Build the project | |
| env: | |
| VCPKG_ROOT: C:/vcpkg | |
| VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
| MSYS2_ARG_CONV_EXCL: "*" | |
| run: cmake --build build |