Skip to content

Commit

Permalink
Merge pull request #7 from bips-hb/CRAN_html_fix
Browse files Browse the repository at this point in the history
innsight 0.1.1: Bugfix with HTML5
  • Loading branch information
nkoenen authored Aug 29, 2022
2 parents 4e2cbcf + 9e7c531 commit 495d154
Show file tree
Hide file tree
Showing 24 changed files with 484 additions and 241 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
^images$
^man/images$
^cran-comments\.md$
^codecov\.yml$
117 changes: 60 additions & 57 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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 is overkill for most R packages and
Expand All @@ -12,111 +12,114 @@ on:

name: R-CMD-check

defaults:
run:
shell: Rscript {0}

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

name: ${{ matrix.config.os }} (${{ matrix.config.r }})
name: ${{ matrix.config.os }} (tf-${{ matrix.config.tf }}, R-${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: 'ubuntu-20.04', tf: 'default', r: 'devel', http-user-agent: 'release'}

- {os: 'ubuntu-20.04' , tf: 'default', r: 'release'}
- {os: 'windows-latest', tf: 'default', r: 'release'}
- {os: 'macOS-latest' , tf: 'default', r: 'release'}

- {os: windows-latest, r: 'release'}
# Use 3.6 to trigger usage of RTools35
- {os: windows-latest, r: '3.6'}
- {os: 'ubuntu-20.04' , tf: 'default', r: 'oldrel'}
- {os: 'windows-latest', tf: 'default', r: 'oldrel'}
# Use 3.6 to trigger usage of RTools35
- {os: 'windows-latest', tf: 'default', r: '3.6'}

# Use older ubuntu to maximise backward compatibility
- {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-18.04, r: 'release'}
- {os: ubuntu-18.04, r: 'oldrel-1'}
- {os: ubuntu-18.04, r: 'oldrel-2'}
- {os: ubuntu-18.04, r: 'oldrel-3'}
- {os: 'ubuntu-20.04', tf: 'default', r: 'oldrel-1'}
- {os: 'ubuntu-20.04', tf: 'default', r: '3.6'}
- {os: 'ubuntu-20.04', tf: 'default', r: '3.5'}

- {os: 'ubuntu-20.04', tf: '2.8', r: 'release'}
- {os: 'ubuntu-20.04', tf: '2.7', r: 'release'}
- {os: 'ubuntu-20.04', tf: '2.6', r: 'release'}
- {os: 'ubuntu-20.04', tf: '2.5', r: 'release'}
- {os: 'ubuntu-20.04', tf: '2.4', r: 'release'}
- {os: 'ubuntu-20.04', tf: '2.3', r: 'release'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: 'true'
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
TORCH_TEST: 1

steps:
- uses: actions/checkout@v2

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

- uses: r-lib/actions/setup-r@v1
id: install-r
- uses: r-lib/actions/setup-r@v2
id: setup-r
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- name: Install pak and query dependencies
- name: Get Date
id: get-date
shell: bash
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
pak::pak_install_extra()
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
shell: Rscript {0}
echo "::set-output name=year-week::$(date -u "+%Y-%U")"
echo "::set-output name=date::$(date -u "+%F")"
- name: Restore R package cache
uses: actions/cache@v2
id: r-package-cache
with:
path: |
${{ env.R_LIBS_USER }}/*
!${{ env.R_LIBS_USER }}/pak
key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-
path: ${{ env.R_LIBS_USER }}
key: ${{ matrix.config.os }}-${{ steps.setup-r.outputs.installed-r-version }}-${{ steps.get-date.outputs.year-week }}

- name: Install remotes
if: steps.r-package-cache.outputs.cache-hit != 'true'
run: install.packages("remotes")

- name: Install system dependencies
if: runner.os == 'Linux'
shell: bash
run: |
pak::local_system_requirements(execute = TRUE)
pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
shell: Rscript {0}
. /etc/os-release
while read -r cmd
do
echo "$cmd"
sudo $cmd
done < <(Rscript -e "writeLines(remotes::system_requirements('$ID-$VERSION_ID'))")
- name: Install dependencies
run: |
pak::local_install_dev_deps(upgrade = TRUE)
pak::pkg_install("rcmdcheck")
shell: Rscript {0}
- name: Install Package + deps
run: remotes::install_local(dependencies = TRUE, force = TRUE)

- name: Install Miniconda
run: |
install.packages("reticulate")
if (.Platform$OS.type == 'windows') {
reticulate::conda_create(packages = c("python=3.7", "numpy"))
} else {
reticulate::install_miniconda()
}
shell: Rscript {0}

- name: Install TensorFlow + Keras
run: |
keras::install_keras()
shell: Rscript {0}
run: reticulate::install_miniconda()

- name: Install Tensorflow + Keras deps
run: keras::install_keras(tensorflow = '${{ matrix.config.tf }}-cpu')

- name: Install LibTorch
run: |
torch::install_torch()
shell: Rscript {0}
run: torch::install_torch()

- name: Install rcmdcheck
run: remotes::install_cran("rcmdcheck")

- name: Check
env:
_R_CHECK_CRAN_INCOMING_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")
shell: Rscript {0}
run: rcmdcheck::rcmdcheck(args = c('--no-manual', '--as-cran'), error_on = 'error', check_dir = 'check')

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
name: ${{ matrix.config.os }}-tf${{ matrix.config.tf }}-r${{ matrix.config.r }}-results
path: check
53 changes: 22 additions & 31 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,55 +1,46 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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: [main, master]
paths:
- "man/*"
- "_pkgdown.yml"
- "pkgdown"
- "NEWS.md"
- "README.Rmd"
- "vignettes"
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

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

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: pkgdown
extra-packages: any::pkgdown, local::.
needs: website

- name: Install Miniconda
run: |
install.packages("reticulate")
reticulate::install_miniconda()
shell: Rscript {0}

- name: Install TensorFlow + Keras
run: |
keras::install_keras()
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Install LibTorch
run: |
torch::install_torch()
shell: Rscript {0}

- name: Deploy package
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
79 changes: 79 additions & 0 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# 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:
issue_comment:
types: [created]

name: Commands

jobs:
document:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
name: document
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::roxygen2
needs: pr-document

- name: Document
run: roxygen2::roxygenise()
shell: Rscript {0}

- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add man/\* NAMESPACE
git commit -m 'Document'
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

style:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }}
name: style
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

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

- name: Install dependencies
run: install.packages("styler")
shell: Rscript {0}

- name: Style
run: styler::style_pkg()
shell: Rscript {0}

- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add \*.R
git commit -m 'Style'
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 495d154

Please sign in to comment.