Skip to content

Merge pull request #5 from flyconnectome/test-coverage #16

Merge pull request #5 from flyconnectome/test-coverage

Merge pull request #5 from flyconnectome/test-coverage #16

Workflow file for this run

# Single-platform (Ubuntu) R CMD check, including the testthat suite, across a
# small matrix of Python versions.
#
# Python is provided the way real users get it -- through reticulate's managed
# miniconda -- rather than a bare system Python, so CI exercises the same kind
# of interpreter nat.python is designed to manage. nat.python itself is installed
# and used to introspect the environment before the check runs. (Phase 2 will
# provision Python through nat.python's own environment engine; until then we
# call reticulate directly.)
#
# The matrix spans the Python range we care about on one platform:
# * reticulate's own default miniconda Python (what most users get);
# * the floor -- Python 3.9, caveclient's current minimum;
# * the ceiling -- Python 3.13, the newest stable release the current
# reticulate fully supports (3.14 is not yet).
on:
push:
branches: [main, master]
pull_request:
workflow_dispatch:
name: R-CMD-check
permissions: read-all
jobs:
R-CMD-check:
runs-on: ubuntu-latest
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config:
- { label: "py-reticulate-default", python: "" }
- { label: "py-3.9-min", python: "3.9" }
- { label: "py-3.13-max", python: "3.13" }
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
# Empty for the "reticulate default" leg; a version string otherwise. Read
# in the provisioning step and applied before install_miniconda() so it
# controls the Python version of reticulate's r-reticulate environment.
NATPY_PYTHON_VERSION: ${{ matrix.config.python }}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check
- name: Provision Python (reticulate miniconda) and install nat.python
run: |
v <- Sys.getenv("NATPY_PYTHON_VERSION")
if (nzchar(v)) {
Sys.setenv(RETICULATE_MINICONDA_PYTHON_VERSION = v)
message("Pinning reticulate miniconda Python to ", v)
} else {
message("Using reticulate's default miniconda Python")
}
reticulate::install_miniconda()
reticulate::py_install(c("numpy", "pandas"))
pak::local_install()
library(nat.python)
print(py_module_info(c("numpy", "pandas")))
py <- reticulate::py_config()$python
cat(sprintf("RETICULATE_PYTHON=%s\n", py),
file = Sys.getenv("GITHUB_ENV"), append = TRUE)
message("Using RETICULATE_PYTHON=", py)
shell: Rscript {0}
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true