diff --git a/.github/workflows/R-CMD-check-hard-push.yaml b/.github/workflows/R-CMD-check-hard-push.yaml new file mode 100644 index 0000000..febbae6 --- /dev/null +++ b/.github/workflows/R-CMD-check-hard-push.yaml @@ -0,0 +1,61 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +# +# NOTE: This workflow only directly installs "hard" dependencies, i.e. Depends, +# Imports, and LinkingTo dependencies. Notably, Suggests dependencies are never +# installed, with the exception of testthat, knitr, and rmarkdown. The cache is +# never used to avoid accidentally restoring a cache containing a suggested +# dependency. +on: + push: + branches: + - master + +name: R-CMD-check-hard + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - { os: windows-latest, r: "release" } + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v3 + + # Always try to use the latest pandoc version + # https://github.com/jgm/pandoc/releases + - uses: r-lib/actions/setup-pandoc@v2 + with: + pandoc-version: "2.19.2" + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + pak-version: devel + dependencies: '"hard"' + cache: false + extra-packages: | + any::rcmdcheck + any::testthat + any::knitr + any::rmarkdown + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true \ No newline at end of file diff --git a/.github/workflows/R-CMD-check-hard.yaml b/.github/workflows/R-CMD-check-hard.yaml new file mode 100644 index 0000000..986595b --- /dev/null +++ b/.github/workflows/R-CMD-check-hard.yaml @@ -0,0 +1,62 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +# +# NOTE: This workflow only directly installs "hard" dependencies, i.e. Depends, +# Imports, and LinkingTo dependencies. Notably, Suggests dependencies are never +# installed, with the exception of testthat, knitr, and rmarkdown. The cache is +# never used to avoid accidentally restoring a cache containing a suggested +# dependency. +on: + pull_request: + branches: + - master + +name: R-CMD-check-hard + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - { os: ubuntu-latest, r: "devel" } + - { os: windows-latest, r: "release" } + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v3 + + # Always try to use the latest pandoc version + # https://github.com/jgm/pandoc/releases + - uses: r-lib/actions/setup-pandoc@v2 + with: + pandoc-version: "2.19.2" + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + pak-version: devel + dependencies: '"hard"' + cache: false + extra-packages: | + any::rcmdcheck + any::testthat + any::knitr + any::rmarkdown + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true \ No newline at end of file diff --git a/.github/workflows/R-CMD-check-push.yaml b/.github/workflows/R-CMD-check-push.yaml new file mode 100644 index 0000000..e0ece6c --- /dev/null +++ b/.github/workflows/R-CMD-check-push.yaml @@ -0,0 +1,128 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help + +on: + push: + branches: + - master + +name: R-CMD-check + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) ${{ matrix.config.locale }} + + strategy: + fail-fast: false + matrix: + config: + ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ## IMPORTANT ## + ## ## + ## Checks are deliberately not run on R-devel. ## + ## This is because they are already run in `R-CMD-check-strict` workflow. ## + ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + - { os: windows-latest, r: "devel" } + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + _R_CHECK_CRAN_INCOMING_: false + _R_CHECK_FORCE_SUGGESTS_: false + + steps: + # - name: Set locale + # if: matrix.config.locale == 'zh_CN.UTF-8' + # run: | + # sudo locale-gen zh_CN.UTF-8 + # echo "LC_ALL=zh_CN.UTF-8" >> $GITHUB_ENV + + - name: Set locale + if: matrix.config.locale == 'en_US' + run: | + sudo locale-gen en_US + echo "LC_ALL=en_US" >> $GITHUB_ENV + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-pandoc@v2 + with: + pandoc-version: "3.1" + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: "release" + use-public-rspm: true + + - name: Install packages from source + run: | + install.packages(c("Matrix", "TMB"), type = "source") + shell: Rscript {0} + + # TODO: Check which of the ignore conditions are still relevant given the + # current suggested dependencies and the minimum supported R version. + # Update if anything out of date or not needed anymore. + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + pak-version: devel + extra-packages: | + any::rcmdcheck + any::BH + TMB=?ignore-before-r=100.0.0 + Matrix=?ignore-before-r=100.0.0 + glmmTMB=?ignore-before-r=100.0.0 + epiR=?ignore-before-r=4.0.0 + gam=?ignore-before-r=4.0.0 + gdtools=?ignore-before-r=4.0.0 + fastICA=?ignore-before-r=4.0.0 + metafor=?ignore-before-r=4.0.0 + panelr=?ignore-before-r=4.0.0 + jtools=?ignore-before-r=4.0.0 + mmrm=?ignore-before-r=4.0.0 + rsvd=?ignore-before-r=4.0.0 + sparsepca=?ignore-before-r=4.0.0 + qqconf=?ignore-before-r=4.0.0 + qqplotr=?ignore-before-r=4.0.0 + ape=?ignore-before-r=4.1.0 + car=?ignore-before-r=4.1.0 + drc=?ignore-before-r=4.1.0 + EGAnet=?ignore-before-r=4.1.0 + ggpubr=?ignore-before-r=4.1.0 + rstatix=?ignore-before-r=4.1.0 + PROreg=?ignore-before-r=4.1.0 + FactoMineR=?ignore-before-r=4.3.0 + factoextra=?ignore-before-r=4.3.0 + sjstats=?ignore-before-r=4.3.0 + nestedLogit=?ignore-before-r=4.3.0 + estimability=?ignore-before-r=4.3.0 + emmeans=?ignore-before-r=4.3.0 + effects=?ignore-before-r=4.3.0 + rmcorr=?ignore-before-r=4.1.0 + randomForest=?ignore-before-r=4.1.0 + MuMIn=?ignore-before-r=4.2.0 + pbkrtest=?ignore-before-r=4.1.0 + afex=?ignore-before-r=4.1.0 + car=?ignore-before-r=4.1.0 + ivreg=?ignore-before-r=4.1.0 + AER=?ignore-before-r=4.1.0 + needs: check + + # install *after* other deps to avoid FreeADFunObject error + - name: Install glmmTMB from source + run: | + install.packages(c("MatrixModels", "glmmTMB"), type = "source") + shell: Rscript {0} + + # Don't error on "note" because if any of the suggested packages are not available + # for a given R version, this generates a NOTE causing unnecessary build failure + - uses: r-lib/actions/check-r-package@v2 + with: + error-on: '"warning"' + upload-snapshots: true diff --git a/.github/workflows/check-all-examples.yaml b/.github/workflows/check-all-examples.yaml new file mode 100644 index 0000000..429c655 --- /dev/null +++ b/.github/workflows/check-all-examples.yaml @@ -0,0 +1,51 @@ +# Make sure all examples run successfully, even the ones that are not supposed +# to be run or tested on CRAN machines by default. +# +# The examples that fail should use +# - `if (FALSE) { ... }` (if example is included only for illustrative purposes) +# - `try({ ... })` (if the intent is to show the error) +# +# This workflow helps find such failing examples that need to be modified. +on: + pull_request: + branches: [master] + +name: check-all-examples + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + check-all-examples: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-r@v2 + with: + #r-version: "devel" + use-public-rspm: true + + - name: Install packages from source + run: | + install.packages(c("Matrix", "TMB"), type = "source") + shell: Rscript {0} + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + #cache-version: 2 + pak-version: devel + extra-packages: | + TMB=?ignore-before-r=100.0.0 + Matrix=?ignore-before-r=100.0.0 + any::devtools + local::. + - name: Run examples + run: | + options(crayon.enabled = TRUE, warn = 2L) + devtools::run_examples(run_dontrun = TRUE, run_donttest = TRUE, document = FALSE) + shell: Rscript {0} diff --git a/.github/workflows/check-link-rot.yaml b/.github/workflows/check-link-rot.yaml new file mode 100644 index 0000000..bddb9ae --- /dev/null +++ b/.github/workflows/check-link-rot.yaml @@ -0,0 +1,45 @@ +on: + pull_request: + branches: [master] + +name: check-link-rot + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + check-link-rot: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-pandoc@v2 + with: + pandoc-version: "3.1" + + - uses: r-lib/actions/setup-r@v2 + with: + #r-version: "devel" + http-user-agent: "release" + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + pak-version: devel + dependencies: '"hard"' + extra-packages: | + any::rcmdcheck + any::urlchecker + - name: Run URL checker + run: | + options(crayon.enabled = TRUE) + rotten_links <- urlchecker::url_check(progress = FALSE) + print(rotten_links) + if (length(rotten_links$URL) > 0L) { + cli::cli_abort("Some URLs are outdated and need to be updated.") + } + shell: Rscript {0} diff --git a/.github/workflows/html-5-check.yaml b/.github/workflows/html-5-check.yaml new file mode 100644 index 0000000..2e0f299 --- /dev/null +++ b/.github/workflows/html-5-check.yaml @@ -0,0 +1,45 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + pull_request: + branches: + - master + +name: HTML5 check + +jobs: + HTML5-check: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: "devel" + http-user-agent: "release" + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + pak-version: devel + extra-packages: any::rcmdcheck, any::V8 + dependencies: "character()" + + - name: Install pdflatex + run: sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra + + - name: Install tidy + run: sudo apt install tidy + + - uses: r-lib/actions/check-r-package@v2 + with: + args: 'c("--as-cran", "--no-codoc", "--no-examples", "--no-tests", "--no-vignettes", "--no-build-vignettes", "--ignore-vignettes", "--no-install")' + build_args: 'c("--no-build-vignettes")' + error-on: '"note"' + env: + _R_CHECK_CRAN_INCOMING_REMOTE_: false + _R_CHECK_CRAN_INCOMING_: false + _R_CHECK_RD_XREFS_: false \ No newline at end of file