Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-paul-2006 committed Jan 25, 2024
1 parent 975fcac commit 981dc72
Show file tree
Hide file tree
Showing 4 changed files with 344 additions and 0 deletions.
103 changes: 103 additions & 0 deletions .github/alt/OS-check_alt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
on:
push:
branches:
- main
pull_request:
branches:
- main

name: OS-check

jobs:
OS-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macOS-latest, r: 'oldrel'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}


env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_TOKEN: ${{ secrets.GHTOKEN2 }}
GITHUB_PAT: ${{ secrets.GHTOKEN2 }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@master

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps("scRNASeq/",dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

# - name: Install XQuartz on macOS
# if: runner.os == 'macOS'
# run: brew cask install xquartz

- name: Install System Dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
sudo apt-get install -y glpk-utils
sudo apt-get install -y libcurl4-openssl-dev
shell: bash {0}

- name: Install XML
if: runner.os == 'Windows'
run: |
install.packages("XML", type = "source")
shell: Rscript {0}

- name: Install dependencies
run: |
remotes::install_deps("scRNASeq/",dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("BiocManager")
BiocManager::install("rmarkdown")
BiocManager::install("devtools")
BiocManager::install("RockefellerUniversity/compileCourses",subdir="compileCourses")
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Install package
if: github.ref == 'refs/heads/master'
run: |
devtools::install("scRNASeq/",dependencies = TRUE,quick = TRUE)
shell: Rscript {0}

- name: CompileCourse
run: |
require(compileCourses)
compileCourses::compileSingleCourseMaterial(repo="RockefellerUniversity",subdir="scRNASeq",branch="master")
shell: Rscript {0}
240 changes: 240 additions & 0 deletions .github/alt/compilation-check_alt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
## Read more about GitHub actions the features of this GitHub Actions workflow
## at https://lcolladotor.github.io/biocthis/articles/biocthis.html#use_bioc_github_action
##
## For more details, check the biocthis developer notes vignette at
## https://lcolladotor.github.io/biocthis/articles/biocthis_dev_notes.html
##
## You can add this workflow to other packages using:
## > biocthis::use_bioc_github_action()
## or
## > usethis::use_github_action("check-bioc", "https://bit.ly/biocthis_gha", "check-bioc.yml")
## without having to install biocthis.
##
## Using GitHub Actions exposes you to many details about how R packages are
## compiled and installed in several operating system.s
### If you need help, please follow the steps listed at
## https://github.com/r-lib/actions#where-to-find-help
##
## If you found an issue specific to biocthis's GHA workflow, please report it
## with the information that will make it easier for others to help you.
## Thank you!



## Acronyms:
## * GHA: GitHub Action
## * OS: operating system

## Specify which branches you want this GHA to run on.
## Bioconductor uses branches such as master (bioc-devel) and RELEASE_* like
## RELEASE_3_10. For more details check
## http://bioconductor.org/developers/how-to/git/
on:
push:
branches:
- main
- 'RELEASE_*'
pull_request:
branches:
- main
- 'RELEASE_*'

name: compilation-check

## These environment variables control whether to run GHA code later on that is
## specific to testthat, covr, and pkgdown.
##
## If you need to clear the cache of packages, update the number inside
## cache-version as discussed at https://github.com/r-lib/actions/issues/86.
## Note that you can always run a GHA test without the cache by using the word
## "/nocache" in the commit message.
env:
has_testthat: 'true'
run_covr: 'true'
run_pkgdown: 'true'
cache-version: 'cache-v1'

jobs:
## This first job uses the GitHub repository branch name to infer what
## version of Bioconductor we will be working on.
define-docker-info:
runs-on: ubuntu-latest
outputs:
imagename: ${{ steps.findinfo.outputs.imagename }}
steps:
- id: findinfo
run: |
## Define the image name and print the information
imagename="bioconductor/bioconductor_docker"
echo $imagename
## Save the information for the next job
echo "::set-output name=imagename::${imagename}"
compilation-check:
## This job then checks the R package using the Bioconductor docker that
## was defined by the previous job. This job will determine what version of
## R to use for the macOS and Windows builds on the next job.
runs-on: ubuntu-latest
needs: define-docker-info

## Name shown on the GHA log
name: ubuntu-latest

## Information used by the next job that will run on macOS and Windows
outputs:
rversion: ${{ steps.findrversion.outputs.rversion }}
biocversionnum: ${{ steps.findrversion.outputs.biocversionnum }}

## Environment variables unique to this job.
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
TZ: UTC
NOT_CRAN: true
GITHUB_TOKEN: ${{ secrets.GHTOKEN2 }}
GITHUB_PAT: ${{ secrets.GHTOKEN2 }}

## The docker container to use. Note that we link a directory on the GHA
## runner to a docker directory, such that we can then cache the linked
## directory. This directory will contain the R packages used.
container:
image: ${{ needs.define-docker-info.outputs.imagename }}
volumes:
- /home/runner/work/_temp/Library:/usr/local/lib/R/host-site-library

steps:
- name: Install Git
run: |
sudo apt-get update -y
sudo apt install make libssl-dev libghc-zlib-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip -y
wget https://github.com/git/git/archive/v2.26.2.zip -O git.zip
unzip git.zip
cd git-*
make prefix=/usr all
sudo make prefix=/usr install
cd -
git --version
shell: bash {0}

- name: Install GitLFS
run: |
sudo apt-get update
sudo apt-get install git-lfs
git lfs install
shell: bash {0}

- name: Install GLPK
run: |
sudo apt-get update -y
sudo apt-get install -y glpk-utils
shell: bash {0}
## Related to https://github.com/actions/checkout/issues/238
## https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-18-04

## Most of these steps are the same as the ones in
## https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml
## If they update their steps, we will also need to update ours.
- name: Checkout
uses: actions/checkout@v2
with:
lfs: true
- name: Checkout LFS objects
run: git lfs pull
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps("scRNASeq/",dependencies = TRUE), ".github/depends.Rds", version = 2)
message(paste('****', Sys.time(), 'installing BiocManager ****'))
remotes::install_cran("BiocManager")
shell: Rscript {0}
## Find the corresponding R version based on the Bioconductor version
## to use for the macOS and Windows checks by the next GHA job
- id: findrversion
name: Find Bioc and R versions
run: |
## Define the R and Bioconductor version numbers
biocversionnum=$(Rscript -e "info <- BiocManager:::.version_map_get_online('https://bioconductor.org/config.yaml'); res <- subset(info, BiocStatus == 'release')[, 'Bioc']; cat(as.character(res))")
rversion=$(Rscript -e "info <- BiocManager:::.version_map_get_online('https://bioconductor.org/config.yaml'); res <- subset(info, BiocStatus == 'release')[, 'R']; cat(as.character(res))")
## Print the results
echo $biocversionnum
echo $rversion
## Save the info for the next job
echo "::set-output name=rversion::${rversion}"
echo "::set-output name=biocversionnum::${biocversionnum}"
shell:
bash {0}

- name: Cache R packages
if: "!contains(github.event.head_commit.message, '/nocache')"
uses: actions/cache@v1
with:
path: /home/runner/work/_temp/Library
key: ${{ env.cache-version }}-${{ runner.os }}-biocdocker-biocbranch-release-r-${{ steps.findrversion.outputs.rversion }}-bioc-${{ steps.findrversion.outputs.biocversionnum }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-biocdocker-biocbranch-release-r-${{ steps.findrversion.outputs.rversion }}-bioc-${{ steps.findrversion.outputs.biocversionnum }}-

- name: Install dependencies
run: |
## Try installing the package dependencies in steps. First the local
## dependencies, then any remaining dependencies to avoid the
## issues described at
## https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016675.html
## https://github.com/r-lib/remotes/issues/296
## Ideally, all dependencies should get installed in the first pass.
## Pass #1 at installing dependencies
message(paste('****', Sys.time(), 'pass number 1 at installing dependencies: local dependencies ****'))
local_deps <- remotes::local_package_deps("scRNASeq/",dependencies = TRUE)
deps <- remotes::dev_package_deps("scRNASeq/",dependencies = TRUE, repos = BiocManager::repositories())
BiocManager::install(local_deps[local_deps %in% deps$package[deps$diff != 0]])
## Pass #2 at installing dependencies
message(paste('****', Sys.time(), 'pass number 2 at installing dependencies: any remaining dependencies ****'))
deps <- remotes::dev_package_deps("scRNASeq/",dependencies = TRUE, repos = BiocManager::repositories())
BiocManager::install(deps$package[deps$diff != 0])
## For running the checks addiotnal cusotm packages can be added here
message(paste('****', Sys.time(), 'installing rcmdcheck and BiocCheck ****'))
remotes::install_cran("rcmdcheck")
BiocManager::install("BiocCheck")
BiocManager::install("rmarkdown")
BiocManager::install("RockefellerUniversity/compileCourses",subdir="compileCourses")
BiocManager::install("devtools")
BiocManager::install("Herper")
devtools::install_github('satijalab/seurat-data')
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Install package
if: github.ref == 'refs/heads/main'
run: R CMD INSTALL ./scRNASeq/

- name: Session info
run: |
require(compileCourses)
compileCourses::compileSingleCourseMaterial(repo="RockefellerUniversity",subdir="scRNASeq",branch="main")
shell: Rscript {0}

- name: Move to docs
run: |
mkdir -p docs
rm -r r_course/*/*/*_cache
cp -r r_course/* docs/
echo "Copied to docs"
shell:
bash {0}

- name: commit
run: |
git config --global user.email "tc.infomatics@gmail.com"
git config --global http.postBuffer 263112000
git add docs/\* r_course/\*
git commit -m 'Autobuild'
git push origin HEAD:refs/heads/main
- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-biocdocker-biocbranch-release-r-${{ steps.findrversion.outputs.rversion }}-bioc-${{ steps.findrversion.outputs.biocversionnum }}-results
path: check
1 change: 1 addition & 0 deletions .github/workflows/compilation-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ jobs:
- name: commit
run: |
git config --global user.email "tc.infomatics@gmail.com"
git config --global http.postBuffer 263112000
git add docs/\* r_course/\*
git commit -m 'Autobuild'
git push origin HEAD:refs/heads/master
Expand Down
Binary file modified introToR/.DS_Store
Binary file not shown.

0 comments on commit 981dc72

Please sign in to comment.