From 166c415873baeff099bca28651ad109cd63ea45a Mon Sep 17 00:00:00 2001 From: pat-s Date: Mon, 24 Oct 2022 12:43:22 +0200 Subject: [PATCH] adjust CI to quarto --- .github/workflows/build-website.yml | 67 ++++++------- .github/workflows/render-gallery.yml | 138 +++++++++++++-------------- mlr-org/.Rprofile | 2 +- 3 files changed, 99 insertions(+), 108 deletions(-) diff --git a/.github/workflows/build-website.yml b/.github/workflows/build-website.yml index 8f69e3070..176ede5bd 100644 --- a/.github/workflows/build-website.yml +++ b/.github/workflows/build-website.yml @@ -18,53 +18,44 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + # - name: Change directory + # run: cd mlr-org - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - r-version: 4.1.3 + # pak-version: devel - - uses: r-lib/actions/setup-pandoc@v2 + # - uses: r-lib/actions/setup-pandoc@v2 + - uses: quarto-dev/quarto-actions/setup@v2 - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - # pak-version: devel - extra-packages: | - any::devtools - - - name: Install Remotes + - name: Install system dependencies + if: runner.os == 'Linux' run: | - devtools::install_github("mlr-org/mlr3book") - devtools::install_github("mlr-org/mlr3extralearners") - devtools::install_github("mlr-org/mlr3proba") - devtools::install_github("mlr-org/mlr3mbo") - devtools::install_github("mlr-org/mlr3spatiotempcv") - devtools::install_github("openml/openml-r") - shell: Rscript {0} - - - name: Install Packages - run: devtools::install() - shell: Rscript {0} + while read -r cmd + do + eval sudo $cmd + done < <(Rscript -e 'install.packages("remotes", repos = "cloud.r-project.org"); cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")') + + - uses: pat-s/actions/setup-renv@renv-subdir + env: + RENV_CONFIG_REPOS_OVERRIDE: ${{ env.RSPM }} + with: + working-directory: mlr-org + cache-version: 2 - - name: Build Website - run: rmarkdown::render_site(input = "mlr-org", encoding = "UTF-8") - shell: Rscript {0} + # - name: Install Packages + # run: devtools::install() + # shell: Rscript {0} - # bug in render_site deletes rss feed - # rss feed with last post can be restored by rendering the post again - # https://github.com/rstudio/distill/issues/381 - - name: Restore RSS Feed - run: | - files = list.files("mlr-org/_posts", ".Rmd", full.names = TRUE, recursive = TRUE) - rmarkdown::render(files[length(files)], encoding = "UTF-8") - shell: Rscript {0} + # - name: Render Quarto Project + # uses: quarto-dev/quarto-actions/render@v2 + # with: + # path: mlr-org - - name: Deploy - if: ${{ github.event_name == 'push' }} - uses: JamesIves/github-pages-deploy-action@4.1.5 + - name: Publish to GitHub Pages (and render) + uses: quarto-dev/quarto-actions/publish@v2 with: - branch: gh-pages - folder: mlr-org/docs - single-commit: false + target: gh-pages diff --git a/.github/workflows/render-gallery.yml b/.github/workflows/render-gallery.yml index e547019a0..8853e20dd 100644 --- a/.github/workflows/render-gallery.yml +++ b/.github/workflows/render-gallery.yml @@ -1,82 +1,82 @@ -on: - workflow_dispatch: - push: - branches: - - main - paths: - - 'mlr-org/_gallery/**' - pull_request: - branches: - - main - paths: - - 'mlr-org/_gallery/**' - schedule: - - cron: "0 6 * * *" +# on: +# workflow_dispatch: +# push: +# branches: +# - main +# paths: +# - 'mlr-org/_gallery/**' +# pull_request: +# branches: +# - main +# paths: +# - 'mlr-org/_gallery/**' +# schedule: +# - cron: "0 6 * * *" -name: render-gallery +# name: render-gallery -jobs: - render-gallery: - runs-on: ubuntu-latest +# jobs: +# render-gallery: +# runs-on: ubuntu-latest - env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} +# env: +# R_REMOTES_NO_ERRORS_FROM_WARNINGS: true +# GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 +# steps: +# - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - r-version: 4.1.3 +# - uses: r-lib/actions/setup-r@v2 +# with: +# use-public-rspm: true +# r-version: 4.1.3 - - uses: r-lib/actions/setup-pandoc@v2 +# - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: | - any::devtools +# - uses: r-lib/actions/setup-r-dependencies@v2 +# with: +# extra-packages: | +# any::devtools - - name: Install Packages - run: devtools::install() - shell: Rscript {0} +# - name: Install Packages +# run: devtools::install() +# shell: Rscript {0} - - name: Render Gallery - run: | - files = list.files("mlr-org/_gallery/", pattern = ".Rmd", full.names = TRUE, recursive = TRUE) - mlr3misc::walk(files, function(file) rmarkdown::render(file, encoding = "UTF-8", params = list(eval_all = FALSE))) - shell: Rscript {0} +# - name: Render Gallery +# run: | +# files = list.files("mlr-org/_gallery/", pattern = ".Rmd", full.names = TRUE, recursive = TRUE) +# mlr3misc::walk(files, function(file) rmarkdown::render(file, encoding = "UTF-8", params = list(eval_all = FALSE))) +# shell: Rscript {0} - - name: Build Website - run: rmarkdown::render_site(input = "mlr-org", encoding = "UTF-8") - shell: Rscript {0} +# - name: Build Website +# run: rmarkdown::render_site(input = "mlr-org", encoding = "UTF-8") +# shell: Rscript {0} - # bug in render_site deletes rss feed - # rss feed with last post can be restored by rendering the post again - # https://github.com/rstudio/distill/issues/381 - - name: Restore RSS Feed - run: | - files = list.files("mlr-org/_posts", ".Rmd", full.names = TRUE, recursive = TRUE) - rmarkdown::render(files[length(files)], encoding = "UTF-8") - shell: Rscript {0} +# # bug in render_site deletes rss feed +# # rss feed with last post can be restored by rendering the post again +# # https://github.com/rstudio/distill/issues/381 +# - name: Restore RSS Feed +# run: | +# files = list.files("mlr-org/_posts", ".Rmd", full.names = TRUE, recursive = TRUE) +# rmarkdown::render(files[length(files)], encoding = "UTF-8") +# shell: Rscript {0} - - name: Commit Results - if: ${{ github.event_name == 'push' }} - run: | - rm -f .github/pkg.lock - git config --local user.name "$GITHUB_ACTOR" - git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" - git config --local pull.rebase false - git pull - git add -A - git commit -m 'refactor: render gallery posts' - git push origin +# - name: Commit Results +# if: ${{ github.event_name == 'push' }} +# run: | +# rm -f .github/pkg.lock +# git config --local user.name "$GITHUB_ACTOR" +# git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" +# git config --local pull.rebase false +# git pull +# git add -A +# git commit -m 'refactor: render gallery posts' +# git push origin - - name: Deploy - if: ${{ github.event_name == 'push' }} - uses: JamesIves/github-pages-deploy-action@4.1.5 - with: - branch: gh-pages - folder: mlr-org/docs - single-commit: false +# - name: Deploy +# if: ${{ github.event_name == 'push' }} +# uses: JamesIves/github-pages-deploy-action@4.1.5 +# with: +# branch: gh-pages +# folder: mlr-org/docs +# single-commit: false diff --git a/mlr-org/.Rprofile b/mlr-org/.Rprofile index 81b960f5c..13efc46cf 100644 --- a/mlr-org/.Rprofile +++ b/mlr-org/.Rprofile @@ -1 +1 @@ -source("renv/activate.R") +# source("renv/activate.R")