|
| 1 | +name: ci |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + |
| 7 | +env: |
| 8 | + _R_CHECK_FORCE_SUGGESTS_: "false" |
| 9 | + |
| 10 | +jobs: |
| 11 | + ci: |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + include: |
| 16 | + - {os: ubuntu-latest} |
| 17 | + - {os: macos-latest} |
| 18 | + |
| 19 | + runs-on: ${{ matrix.os }} |
| 20 | + |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + |
| 24 | + # OpenTimelineIO is not packaged for apt/brew as a C++ library, so we |
| 25 | + # build it from source. The INSTALLED tree (~/otio) is cached per OS + |
| 26 | + # version, so the compile happens exactly once per OS; later runs just |
| 27 | + # restore the files. Everything lives OUTSIDE the package working |
| 28 | + # directory so R CMD build/check never sees the clone or build trees. |
| 29 | + # Imath and RapidJSON come from OTIO's bundled submodules. |
| 30 | + - name: Cache OpenTimelineIO (built once, then reused) |
| 31 | + id: otio-cache |
| 32 | + uses: actions/cache@v4 |
| 33 | + with: |
| 34 | + path: ~/otio |
| 35 | + key: otio-v0.18.1-${{ matrix.os }}-2 |
| 36 | + |
| 37 | + - name: Build OpenTimelineIO (only on a cache miss) |
| 38 | + if: steps.otio-cache.outputs.cache-hit != 'true' |
| 39 | + run: | |
| 40 | + set -e |
| 41 | + git clone --recursive --depth 1 --branch v0.18.1 \ |
| 42 | + https://github.com/AcademySoftwareFoundation/OpenTimelineIO.git "$RUNNER_TEMP/otio-src" |
| 43 | + cmake -S "$RUNNER_TEMP/otio-src" -B "$RUNNER_TEMP/otio-build" \ |
| 44 | + -DCMAKE_BUILD_TYPE=Release \ |
| 45 | + -DCMAKE_INSTALL_PREFIX="$HOME/otio" \ |
| 46 | + -DOTIO_CXX_INSTALL=ON \ |
| 47 | + -DOTIO_PYTHON_INSTALL=OFF \ |
| 48 | + -DOTIO_DEPENDENCIES_INSTALL=ON \ |
| 49 | + -DOTIO_FIND_IMATH=OFF \ |
| 50 | + -DOTIO_SHARED_LIBS=ON |
| 51 | + cmake --build "$RUNNER_TEMP/otio-build" --parallel 3 |
| 52 | + cmake --install "$RUNNER_TEMP/otio-build" |
| 53 | +
|
| 54 | + # Point the package build (and runtime loader) at the cached tree. |
| 55 | + - name: Point the build at OpenTimelineIO |
| 56 | + run: | |
| 57 | + echo "OTIO_HOME=$HOME/otio" >> "$GITHUB_ENV" |
| 58 | + echo "LD_LIBRARY_PATH=$HOME/otio/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV" |
| 59 | + echo "DYLD_FALLBACK_LIBRARY_PATH=$HOME/otio/lib:$DYLD_FALLBACK_LIBRARY_PATH" >> "$GITHUB_ENV" |
| 60 | +
|
| 61 | + - name: Setup r-ci |
| 62 | + uses: eddelbuettel/github-actions/r-ci@master |
| 63 | + |
| 64 | + - name: Install dependencies |
| 65 | + run: ./run.sh install_deps |
| 66 | + |
| 67 | + # simplermarkdown builds the vignette during R CMD build; it is a |
| 68 | + # Suggests, which install_deps may skip. |
| 69 | + - name: Install vignette builder |
| 70 | + run: Rscript -e 'if (!requireNamespace("simplermarkdown", quietly = TRUE)) install.packages("simplermarkdown")' |
| 71 | + |
| 72 | + # Build and check explicitly rather than ./run.sh run_tests: r-ci's |
| 73 | + # run_tests passes --no-build-vignettes, which leaves inst/doc empty |
| 74 | + # and makes R CMD check warn about the orphaned vignettes/ directory. |
| 75 | + # We want the vignette built and its code run as part of the check. |
| 76 | + - name: Build |
| 77 | + run: R CMD build . |
| 78 | + |
| 79 | + - name: Check |
| 80 | + run: R CMD check rotio_*.tar.gz --no-manual --as-cran --install-args=--install-tests |
0 commit comments