Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mem48 authored Sep 9, 2024
0 parents commit 6c14f89
Show file tree
Hide file tree
Showing 32 changed files with 3,872 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
^.*\.Rproj$
^\.Rproj\.user$
^\.ccache$
^\.github$
^tic\.R$
120 changes: 120 additions & 0 deletions .github/workflows/tic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
## tic GitHub Actions template: linux-macos-windows-deploy
## revision date: 2020-06-14
on:
push:
pull_request:
# for now, CRON jobs only run on the default branch of the repo (i.e. usually on master)
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 4 * * *"

name: tic

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

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

strategy:
fail-fast: false
matrix:
config:
# use a different tic template type if you do not want to build on all listed platforms
- { os: windows-latest, r: "release" }
- { os: macOS-latest, r: "release", pkgdown: "true", latex: "true" }
- { os: macOS-latest, r: "devel" }
- { os: ubuntu-latest, r: "release" }

env:
# otherwise remotes::fun() errors cause the build to fail. Example: Unavailability of binaries
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
CRAN: ${{ matrix.config.cran }}
# make sure to run `tic::use_ghactions_deploy()` to set up deployment
TIC_DEPLOY_KEY: ${{ secrets.TIC_DEPLOY_KEY }}
# prevent rgl issues because no X11 display is available
RGL_USE_NULL: true
# if you use bookdown or blogdown, replace "PKGDOWN" by the respective
# capitalized term. This also might need to be done in tic.R
BUILD_PKGDOWN: ${{ matrix.config.pkgdown }}
# macOS >= 10.15.4 linking
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
# use GITHUB_TOKEN from GitHub to workaround rate limits in {remotes}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/[email protected]

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

# LaTeX. Installation time:
# Linux: ~ 1 min
# macOS: ~ 1 min 30s
# Windows: never finishes
- uses: r-lib/actions/setup-tinytex@master
if: matrix.config.latex == 'true'

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

# set date/week for use in cache creation
# https://github.community/t5/GitHub-Actions/How-to-set-and-access-a-Workflow-variable/m-p/42970
# - cache R packages daily
- name: "[Cache] Prepare daily timestamp for cache"
if: runner.os != 'Windows'
id: date
run: echo "::set-output name=date::$(date '+%d-%m')"

- name: "[Cache] Cache R packages"
if: runner.os != 'Windows'
uses: pat-s/[email protected]
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}

# for some strange Windows reason this step and the next one need to be decoupled
- name: "[Stage] Prepare"
run: |
Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'source')"
Rscript -e "if (getRversion() < '3.2' && !requireNamespace('curl')) install.packages('curl', type = 'source')"
- name: "[Stage] [Linux] Install curl"
if: runner.os == 'Linux'
run: sudo apt install libcurl4-openssl-dev

- name: "[Stage] Install"
if: matrix.config.os != 'macOS-latest' || matrix.config.r != 'devel'
run: Rscript -e "remotes::install_github('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()"

# macOS devel needs its own stage because we need to work with an option to suppress the usage of binaries
- name: "[Stage] Prepare & Install (macOS-devel)"
if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'devel'
run: |
echo -e 'options(Ncpus = 4, pkgType = "source", repos = structure(c(CRAN = "https://cloud.r-project.org/")))' > $HOME/.Rprofile
Rscript -e "remotes::install_github('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()"
- name: "[Stage] Script"
run: Rscript -e 'tic::script()'

- name: "[Stage] After Success"
if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'release'
run: Rscript -e "tic::after_success()"

- name: "[Stage] Upload R CMD check artifacts"
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
- name: "[Stage] Before Deploy"
run: |
Rscript -e "tic::before_deploy()"
- name: "[Stage] Deploy"
run: Rscript -e "tic::deploy()"

- name: "[Stage] After Deploy"
run: Rscript -e "tic::after_deploy()"
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
inst/doc
.Rhistory
.RData
.Rproj.user
.DS_Store
julyukrelease_tcm77-369384.xls
wu03ew_v2.csv
docs/
25 changes: 25 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Contributor Code of Conduct

As contributors and maintainers of this project, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating documentation,
submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for
everyone, regardless of level of experience, gender, gender identity and expression,
sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.

Examples of unacceptable behavior by participants include the use of sexual language or
imagery, derogatory comments or personal attacks, trolling, public or private harassment,
insults, or other unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject comments,
commits, code, wiki edits, issues, and other contributions that are not aligned to this
Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed
from the project team.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
opening an issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the Contributor Covenant
(http://contributor-covenant.org), version 1.0.0, available at
http://contributor-covenant.org/version/1/0/0/
30 changes: 30 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Package: RPackageTemplate
Type: Package
Title: What the Package Does (Title Case)
Version: 0.1.0
Authors@R: c(
person("Malcolm", "Morgan", email = "[email protected]", role = c("aut"),
comment = c(ORCID = "0000-0002-9488-9183")),
person("Robin", "Lovelace", email = "[email protected]", role = c("aut","cre"),
comment = c(ORCID = "0000-0001-5679-6536"))
)
Maintainer: The package maintainer <[email protected]>
Description: More about what it does (maybe more than one line)
Use four spaces when indenting paragraphs within the Description.
Language: EN-GB
License: file LICENSE
URL: https://github.com/ITSLeeds/RPackageTemplate, https://itsleeds.github.io/RPackageTemplate/
BugReports: https://github.com/ITSLeeds/RPackageTemplate/issues
Encoding: UTF-8
LazyData: true
Imports:
usethis,
devtools,
goodpractice
RoxygenNote: 6.1.1
Suggests:
covr,
knitr,
rmarkdown,
testthat
VignetteBuilder: knitr
Loading

0 comments on commit 6c14f89

Please sign in to comment.