Skip to content

Commit

Permalink
[r] [ci] Migrate R CI to r-lib/actions (#3732)
Browse files Browse the repository at this point in the history
* [r] [ci] Migrate R CI to r-lib/actions
Use r-lib/actions instead of `tools/r-ci.sh` for R and interop CI; also makes use of
RSPM/P3M + pak for binaries and system requirements

[SC-63716](https://app.shortcut.com/tiledb-inc/story/63716)
  • Loading branch information
mojaveazure authored Feb 25, 2025
1 parent 967fc04 commit ff93807
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 41 deletions.
54 changes: 20 additions & 34 deletions .github/workflows/r-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ on:
env:
COVERAGE_FLAGS: "r"
COVERAGE_TOKEN: ${{ secrets.CODECOV_TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
_R_CHECK_TESTS_NLINES_: 0
CATCHSEGV: "TRUE"
R_REMOTES_UPGRADE: "never"
Expand Down Expand Up @@ -57,47 +59,31 @@ jobs:
if: ${{ matrix.os == 'macOS-latest' }}
run: sysctl -a | grep cpu

- name: Bootstrap
run: cd apis/r && tools/r-ci.sh bootstrap
- uses: r-lib/actions/setup-pandoc@v2

- name: Install BioConductor package SingleCellExperiment
run: cd apis/r && tools/r-ci.sh install_bioc SingleCellExperiment
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
extra-repositories: https://tiledb-inc.r-universe.dev

# Uncomment these next two stanzas as needed whenever we've just released a new tiledb-r for
# which source is available but CRAN releases (and hence update r2u binaries) are not yet:
#
# IMPORTANT: these two stanzas should remain uncommented _only_ during the propagation time
# between (a) publication of source for a new TileDB-R _upon which_ TileDB-SOMA depends in its
# apis/R/DESCRIPTION file and (b) appearance of binaries.
#
# Please see https://github.com/single-cell-data/TileDB-SOMA/wiki/Branches-and-releases which
# is crucial for anyone doing releases of TileDB-SOMA.
#
# Please edit both files in the same way:
# * r-ci.yml
# * r-python-interop-testing.yml
#
# Do not remove these comments until such time as we have eliminated our dependency on
# the TileDB-R package.

#- name: Install r-universe build of tiledb-r (macOS)
# if: ${{ matrix.os == 'macOS-latest' }}
# run: cd apis/r && Rscript -e "install.packages('tiledb', repos = c('https://eddelbuettel.r-universe.dev', 'https://cloud.r-project.org'))"

#- name: Install r-universe build of tiledb-r (linux)
# if: ${{ matrix.os != 'macOS-latest' }}
# run: cd apis/r && Rscript -e "options(bspm.version.check=TRUE); install.packages('tiledb', repos = c('https://eddelbuettel.r-universe.dev/bin/linux/jammy/4.3/', 'https://cloud.r-project.org'))"
- name: P3M Bioconductor
run: |
cat(
'options(BioC_mirror = "https://packagemanager.posit.co/bioconductor/latest")\n',
'options(BIOCONDUCTOR_CONFIG_FILE = "https://packagemanager.posit.co/bioconductor/latest/config.yaml")\n',
sep = '',
file = '~/.Rprofile',
append = TRUE
)
shell: Rscript {0}

- name: R Package Type (macOS)
if: ${{ matrix.os == 'macOS-latest' }}
run: echo 'options(pkgType = "binary")' | tee -a "$(R RHOME)/etc/Rprofile.site"

- name: Dependencies
run: cd apis/r && Rscript -e "remotes::install_deps(dependencies = TRUE, upgrade = FALSE)"

# - name: Install dataset packages from source (macOS)
# if: ${{ matrix.os == 'macOS-latest' }}
# run: cd apis/r && _CI_PKG_TYPE_=both _CI_USE_BIOC_=true Rscript tools/install_missing_deps.R
- uses: r-lib/actions/setup-r-dependencies@v2
with:
working-directory: 'apis/r/'

# - name: CMake
# uses: lukka/get-cmake@latest
Expand Down
27 changes: 20 additions & 7 deletions .github/workflows/r-python-interop-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,27 @@ jobs:
with:
fetch-depth: 0 # ensure we get all tags to inform package version determination

- name: Bootstrap
run: cd apis/r && tools/r-ci.sh bootstrap
- uses: r-lib/actions/setup-pandoc@v2

- name: Dependencies
run: cd apis/r && Rscript -e "remotes::install_deps(dependencies = TRUE, upgrade = FALSE)"
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
extra-repositories: https://tiledb-inc.r-universe.dev

- name: P3M Bioconductor
run: |
cat(
'options(BioC_mirror = "https://packagemanager.posit.co/bioconductor/latest")\n',
'options(BIOCONDUCTOR_CONFIG_FILE = "https://packagemanager.posit.co/bioconductor/latest/config.yaml")\n',
sep = '',
file = '~/.Rprofile',
append = TRUE
)
shell: Rscript {0}

- uses: r-lib/actions/setup-r-dependencies@v2
with:
working-directory: 'apis/r/'

- name: Build Package
run: cd apis/r && R CMD build --no-build-vignettes --no-manual .
Expand Down Expand Up @@ -84,9 +100,6 @@ jobs:
python -c 'import tiledbsoma; tiledbsoma.show_package_versions()'
python scripts/show-versions.py
- name: Update Packages
run: Rscript -e 'update.packages(ask=FALSE)'

- name: Interop tests
run: python -m pytest apis/system/tests/
env:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ apis/r/src/cmake_log.txt
apis/r/.editorconfig
!apis/r/man/roxygen/*
apis/r/**/local/*
apis/r/.Rproj*
apis/r/*.Rproj
apis/r/.Rhistory

# Coverage/codecov
.coverage
Expand Down

0 comments on commit ff93807

Please sign in to comment.