Skip to content

Commit

Permalink
update special
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-s committed Sep 15, 2022
1 parent aae2bff commit eb62c44
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 194 deletions.
164 changes: 82 additions & 82 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,92 +1,92 @@
version: 2.1
jobs:
r-release:
docker:
- image: rocker/verse
steps:
- checkout
# version: 2.1
# jobs:
# r-release:
# docker:
# - image: rocker/verse
# steps:
# - checkout

# create a unique env var for the cache. Unfortunately normal env vars
# are not picked up by the cache, therefore this workaround is needed.
# See https://discuss.circleci.com/t/cannot-use-circle-yml-environment-variables-in-cache-keys/10994/7
- run: echo "$(date '+%d-%m')-r-release" > /tmp/_tmp_file
- restore_cache:
key: R-package-library-{{ checksum "/tmp/_tmp_file" }}
# # create a unique env var for the cache. Unfortunately normal env vars
# # are not picked up by the cache, therefore this workaround is needed.
# # See https://discuss.circleci.com/t/cannot-use-circle-yml-environment-variables-in-cache-keys/10994/7
# - run: echo "$(date '+%d-%m')-r-release" > /tmp/_tmp_file
# - restore_cache:
# key: R-package-library-{{ checksum "/tmp/_tmp_file" }}

# install deps and check pkg ---------------------------------------------
- run:
name: "[r-release] Install dependencies"
command: |
sudo apt update && sudo apt install -y pandoc
R -q -e "install.packages('pak', repos = 'https://r-lib.github.io/p/pak/devel')"
R -q -e "if (grepl('Ubuntu', Sys.info()[['version']])) {options(repos = c(CRAN = sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))))}; pak::local_install_dev_deps()"
# R -q -e "pak::pkg_install(c('alan-turing-institute/distr6', 'xoopR/param6', 'mlr-org/mlr3proba'))"
R -q -e "pak::local_install()"
# # install deps and check pkg ---------------------------------------------
# - run:
# name: "[r-release] Install dependencies"
# command: |
# sudo apt update && sudo apt install -y pandoc
# R -q -e "install.packages('pak', repos = 'https://r-lib.github.io/p/pak/devel')"
# R -q -e "if (grepl('Ubuntu', Sys.info()[['version']])) {options(repos = c(CRAN = sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))))}; pak::local_install_dev_deps()"
# # R -q -e "pak::pkg_install(c('alan-turing-institute/distr6', 'xoopR/param6', 'mlr-org/mlr3proba'))"
# R -q -e "pak::local_install()"

- run:
name: "Render book"
no_output_timeout: 60m
command: |
sudo apt update && sudo apt install -y gdebi-core curl
curl -sL -O https://github.com/quarto-dev/quarto-cli/releases/download/v1.1.149/quarto-1.1.149-linux-amd64.deb
sudo gdebi -n -qq quarto-1.1.149-linux-amd64.deb
quarto render book/
# - run:
# name: "Render book"
# no_output_timeout: 60m
# command: |
# sudo apt update && sudo apt install -y gdebi-core curl
# curl -sL -O https://github.com/quarto-dev/quarto-cli/releases/download/v1.1.149/quarto-1.1.149-linux-amd64.deb
# sudo gdebi -n -qq quarto-1.1.149-linux-amd64.deb
# quarto render book/

- run:
name: "Add .lycheeignore"
command: cp .lycheeignore book/_book/.lycheeignore
# - run:
# name: "Add .lycheeignore"
# command: cp .lycheeignore book/_book/.lycheeignore

# save R pkg cache -------------------------------------------------------
- save_cache:
key: R-package-library-{{ checksum "/tmp/_tmp_file" }}
paths:
- /usr/local/lib/R/site-library
# deploy:
# environment:
# # 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: true
# # save R pkg cache -------------------------------------------------------
# - save_cache:
# key: R-package-library-{{ checksum "/tmp/_tmp_file" }}
# paths:
# - /usr/local/lib/R/site-library
# # deploy:
# # environment:
# # # 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: true

# docker:
# - image: rocker/verse
# steps:
# - checkout
# # docker:
# # - image: rocker/verse
# # steps:
# # - checkout

# - run: echo "$(date '+%d-%m')-r-release" > /tmp/_tmp_file
# - restore_cache:
# key: R-package-library-{{ checksum "/tmp/_tmp_file" }}
# # - run: echo "$(date '+%d-%m')-r-release" > /tmp/_tmp_file
# # - restore_cache:
# # key: R-package-library-{{ checksum "/tmp/_tmp_file" }}

# - run:
# name: Deploy
# command: |
# sudo apt update && sudo apt install -y pandoc
# R -q -e "install.packages('pak', repos = 'https://r-lib.github.io/p/pak/devel')"
# R -q -e "if (grepl('Ubuntu', Sys.info()[['version']])) {options(repos = c(CRAN = sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))))}; pak::pkg_install('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()"
# R -q -e 'tic::before_deploy()'
# R -q -e 'tic::deploy()'
# R -q -e 'tic::after_deploy()'
# # - run:
# # name: Deploy
# # command: |
# # sudo apt update && sudo apt install -y pandoc
# # R -q -e "install.packages('pak', repos = 'https://r-lib.github.io/p/pak/devel')"
# # R -q -e "if (grepl('Ubuntu', Sys.info()[['version']])) {options(repos = c(CRAN = sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))))}; pak::pkg_install('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()"
# # R -q -e 'tic::before_deploy()'
# # R -q -e 'tic::deploy()'
# # R -q -e 'tic::after_deploy()'

workflows:
build-and-deploy:
jobs:
- r-release
# - deploy:
# requires:
# - r-release
# workflows:
# build-and-deploy:
# jobs:
# - r-release
# # - deploy:
# # requires:
# # - r-release

# CRON job daily at 4 am in the morning
# - runs the "build" job on the master branch and builds package cache
nightly:
triggers:
- schedule:
cron: "0 4 * * *"
filters:
branches:
only:
- master
- main
- cran-*
- pak
jobs:
- r-release
# Custom user code -------------------------------------------------------------
# # CRON job daily at 4 am in the morning
# # - runs the "build" job on the master branch and builds package cache
# nightly:
# triggers:
# - schedule:
# cron: "0 4 * * *"
# filters:
# branches:
# only:
# - master
# - main
# - cran-*
# - pak
# jobs:
# - r-release
# # Custom user code -------------------------------------------------------------
208 changes: 104 additions & 104 deletions .github/workflows/build-book.yml
Original file line number Diff line number Diff line change
@@ -1,104 +1,104 @@
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 4 * * *"

name: mlr3book

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

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

strategy:
fail-fast: false
matrix:
config:
- {
os: ubuntu-20.04,
r: "release",
rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest",
}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
# 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 }}

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

- name: Setup tinytex
uses: r-lib/actions/setup-tinytex@v2

- uses: quarto-dev/quarto-actions/setup@v2

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

# 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/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: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')
- name: Install dependencies
run: make install

- name: Install mlr3proba from R-universe
run: |
remotes::install_github("alan-turing-institute/distr6")
remotes::install_github("xoopR/param6")
install.packages('mlr3proba', repos = 'https://mlr-org.r-universe.dev')
shell: Rscript {0}

- name: Render book
run: quarto render book/

- name: Add .lycheeignore
run: cp .lycheeignore book/_book/.lycheeignore

- name: Deploy
if: ${{ github.event_name == 'push' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: book/_book
single-commit: true
# on:
# workflow_dispatch:
# push:
# branches:
# - main
# pull_request:
# branches:
# - main
# schedule:
# - cron: "0 4 * * *"

# name: mlr3book

# jobs:
# R-CMD-check:
# runs-on: ${{ matrix.config.os }}

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

# strategy:
# fail-fast: false
# matrix:
# config:
# - {
# os: ubuntu-20.04,
# r: "release",
# rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest",
# }

# env:
# R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
# RSPM: ${{ matrix.config.rspm }}
# # 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 }}

# - uses: r-lib/actions/setup-pandoc@v2

# - name: Setup tinytex
# uses: r-lib/actions/setup-tinytex@v2

# - uses: quarto-dev/quarto-actions/setup@v2

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

# # 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/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: Install system dependencies
# if: runner.os == 'Linux'
# run: |
# while read -r cmd
# do
# eval sudo $cmd
# done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')

# - name: Install dependencies
# run: make install

# - name: Install mlr3proba from R-universe
# run: |
# remotes::install_github("alan-turing-institute/distr6")
# remotes::install_github("xoopR/param6")
# install.packages('mlr3proba', repos = 'https://mlr-org.r-universe.dev')
# shell: Rscript {0}

# - name: Render book
# run: quarto render book/

# - name: Add .lycheeignore
# run: cp .lycheeignore book/_book/.lycheeignore

# - name: Deploy
# if: ${{ github.event_name == 'push' }}
# uses: JamesIves/github-pages-deploy-action@v4
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# branch: gh-pages
# folder: book/_book
# single-commit: true
Loading

0 comments on commit eb62c44

Please sign in to comment.