Skip to content

Commit 86aa792

Browse files
Add r-ci GitHub Actions CI (Ubuntu + macOS) (#7)
* Add r-ci GitHub Actions CI (Ubuntu + macOS) OpenTimelineIO is not packaged for apt/brew as a C++ library, so the workflow builds it from source (v0.18.1, bundled Imath/RapidJSON) and caches the INSTALLED tree per OS + version: the compile happens once on the first run per OS, every later run restores the files and skips CMake. The package is pointed at the cached tree via OTIO_HOME (no sudo, no /usr/local), so Makevars now uses `OTIO_HOME ?= /usr/local` to let an exported value win; the rpath baked from it resolves libopentimelineio at runtime. Then the standard r-ci flow (install_deps / run_tests). * Bump version to 0.0.0.6 * CI: build OTIO outside the package tree, install vignette builder The first run was green but --as-cran flagged warnings caused by the OTIO clone/build dirs living inside the workspace (R CMD check swept up their executables and GNU-extension Makefiles) and by simplermarkdown not being installed (so the vignette could not build). Move the OTIO clone/build to $RUNNER_TEMP and the cached install to ~/otio (all outside the package dir), and install simplermarkdown before run_tests. Also point the OpenTimelineIO doc link at its canonical URL (opentimeline.io 301s). * CI: build with vignettes and check explicitly r-ci run_tests builds with --no-build-vignettes, leaving inst/doc empty and tripping the vignettes check WARNING. Replace it with explicit R CMD build . + R CMD check --as-cran so the vignette is built and its code exercised during the check.
1 parent f747d0c commit 86aa792

6 files changed

Lines changed: 94 additions & 5 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: rotio
22
Type: Package
33
Title: R Bindings for OpenTimelineIO
4-
Version: 0.0.0.5
4+
Version: 0.0.0.6
55
Date: 2026-06-04
66
Authors@R: c(
77
person("Troy", "Hernandez", role = c("aut", "cre"),

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# rotio 0.0.0.6
2+
3+
* Add GitHub Actions CI (r-ci) on Ubuntu and macOS, building
4+
OpenTimelineIO from source once per runner and caching the install.
5+
* `src/Makevars` now honours an exported `OTIO_HOME` (via `?=`).
6+
17
# rotio 0.0.0.5
28

39
* Add a getting-started vignette (`vignette("rotio")`) built with

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# rotio
22

3-
R bindings for [OpenTimelineIO](https://opentimeline.io) (OTIO), built as
3+
R bindings for [OpenTimelineIO](https://github.com/AcademySoftwareFoundation/OpenTimelineIO) (OTIO), built as
44
an Rcpp wrapper over the OTIO C++ library (0.18.x).
55

66
It covers the time types, the schema classes, tree construction, JSON

src/Makevars

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
## OpenTimelineIO is installed under /usr/local by the cornball.ai build.
2-
## Override OTIO_HOME at install time to point elsewhere, e.g.
2+
## Override OTIO_HOME to point elsewhere, either via the environment
3+
## OTIO_HOME=/opt/otio R CMD INSTALL rotio
4+
## or at install time
35
## R CMD INSTALL --configure-vars='OTIO_HOME=/opt/otio' rotio
4-
OTIO_HOME = /usr/local
6+
## (?= lets an exported OTIO_HOME win; CI points it at a cached build.)
7+
OTIO_HOME ?= /usr/local
58

69
CXX_STD = CXX17
710

vignettes/rotio.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
title: "Getting started with rotio"
77
---
88

9-
`rotio` is an R binding for [OpenTimelineIO](https://opentimeline.io)
9+
`rotio` is an R binding for [OpenTimelineIO](https://github.com/AcademySoftwareFoundation/OpenTimelineIO)
1010
(OTIO), the editorial timeline interchange format. It wraps the OTIO C++
1111
library with Rcpp, so you build and edit real OTIO objects from R and read
1212
or write `.otio` JSON that other tools understand.

0 commit comments

Comments
 (0)