Skip to content

Merge pull request #98 from bedatadriven/billing-info-functions #270

Merge pull request #98 from bedatadriven/billing-info-functions

Merge pull request #98 from bedatadriven/billing-info-functions #270

Workflow file for this run

## tic GitHub Actions template: linux-macos-windows-deploy
## revision date: 2022-11-23
on:
workflow_dispatch:
push:
branches:
- main
- master
- cran-*
- version-*
pull_request:
name: tic
env:
TEST_URL: ${{ secrets.TEST_URL }}
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: ubuntu-latest, r: "devel" }
- { os: ubuntu-latest, r: "release" }
env:
# 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 }}
# use GITHUB_TOKEN from GitHub to workaround rate limits in {remotes}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
Ncpus: 4
- uses: r-lib/actions/setup-tinytex@v2
if: matrix.config.latex == 'true'
- uses: r-lib/actions/setup-pandoc@v2
# 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 "date=$(date '+%d-%m')" >> $GITHUB_OUTPUT
- name: "[Cache] Cache R packages"
if: runner.os != 'Windows'
uses: pat-s/always-upload-cache@v3
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}}
- name: "[Stage] Install pak"
run: Rscript -e "install.packages('pak', repos = 'https://r-lib.github.io/p/pak/stable')"
- name: "[Stage] Install"
run: Rscript -e "if (grepl('Ubuntu', Sys.info()[['version']]) && !grepl('Under development', R.version[['status']])) {options(repos = c(CRAN = sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))))}else{options(repos = c(CRAN = 'cloud.r-project.org'))}; pak::pkg_install('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()"
- name: "[Stage] Script"
env:
TEST_URL: ${{ secrets.TEST_URL }}
run: Rscript -e 'tic::script()'
- name: "[Stage] After Success"
run: Rscript -e "tic::after_success()"
- name: "[Stage] Upload R CMD check artifacts"
if: failure()
uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check