Skip to content

Commit

Permalink
Merge pull request #2 from BerriJ/dev
Browse files Browse the repository at this point in the history
Release 1.0.0
  • Loading branch information
BerriJ authored Mar 8, 2024
2 parents 1f3db0b + 674f89d commit 323ec74
Show file tree
Hide file tree
Showing 37 changed files with 1,441 additions and 508 deletions.
17 changes: 15 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
^.*\.Rproj$
^\.Rproj\.user$
.vscode
.devcontainer
.dev
^\.github$
^_pkgdown\.yml$
^docs$
^pkgdown$
^man-roxygen
src/test.cpp
cran-comments.md
^CRAN-RELEASE$
^LICENSE\.md$
^CRAN-SUBMISSION$
inst/include/cpptimer/.git
^cran-comments\.md$
75 changes: 75 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"name": "DevEnv",
"image": "ghcr.io/berrij/devenv:latest",
// Grant xhost access to root user in order to start x11 devices (r plots)
"initializeCommand": "docker pull ghcr.io/berrij/devenv:latest",
"customizations": {
"vscode": {
// Extensions will get installed automatically
"extensions": [
// C++
"ms-vscode.cpptools-extension-pack",
// Python
"ms-python.vscode-pylance",
"ms-python.python",
"ms-python.black-formatter",
"visualstudioexptteam.vscodeintellicode",
"ms-toolsai.jupyter",
// R
"REditorSupport.r",
"rdebugger.r-debugger",
// Latex
"james-yu.latex-workshop",
"znck.grammarly",
// Git
"mhutchie.git-graph",
"github.vscode-pull-request-github",
// Markdown
"yzhang.markdown-all-in-one",
// Preview HTML
"daiyy.quick-html-previewer",
// Make fancy screenshots
"jeffersonlicet.snipped",
// Live Share
"ms-vsliveshare.vsliveshare",
// Copilot
"GitHub.copilot"
],
// Set *default* container specific settings
// Important for radian and latex
"settings": {
// C++
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE": "/usr/vcpkg/scripts/buildsystems/vcpkg.cmake"
},
// Python
"jupyter.notebookFileRoot": "${workspaceFolder}",
"python.pythonPath": "/usr/bin/python3",
"python.dataScience.interactiveWindowMode": "perFile",
"python.dataScience.sendSelectionToInteractiveWindow": true,
// R
"r.rterm.linux": "/usr/local/bin/radian",
"r.bracketedPaste": true,
"r.sessionWatcher": true,
"r.plot.useHttpgd": true,
"r.plot.defaults.fullWindowMode": true,
// Latex
"latex-workshop.latex.recipe.default": "latexmk (lualatex)",
"latex-workshop.latex.autoBuild.run": "onFileChange",
"latex-workshop.view.pdf.viewer": "tab",
"latex-workshop.linting.chktex.enabled": true,
"latex-workshop.linting.run": "onType",
"latex-workshop.synctex.afterBuild.enabled": true,
"latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",
"latex-workshop.intellisense.unimathsymbols.enabled": true,
// Format code as you type
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"editor.formatOnSave": true,
// Hide .gitignore files
"explorer.excludeGitIgnore": true
}
}
}
}
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
55 changes: 55 additions & 0 deletions .github/workflows/R-CMD-check-Dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
on: [push, pull_request]

name: R-CMD-check-Dev

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

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

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
with:
submodules: 'true'

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

- 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:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2

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

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
56 changes: 56 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
on:
pull_request

name: R-CMD-check

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

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

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
with:
submodules: 'true'

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

- 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:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2

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

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
41 changes: 41 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on: push

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 }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'

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

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

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

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
clean: false
branch: gh-pages
folder: docs
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.dev/*
docs
src/*.o
src/*.so
src/*.dll
src/test.cpp
.vscode/.*
inst/doc
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "inst/include/cpptimer"]
path = inst/include/cpptimer
url = git@github.com:BerriJ/cpptimer.git
22 changes: 22 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/local/lib/R/site-library/Rcpp/include",
"/usr/local/lib/R/site-library/RcppArmadillo/include",
"/usr/local/lib/R/site-library/RcppProgress/include",
"/usr/local/lib/R/site-library/splines2/include",
"/usr/share/R/include"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "linux-gcc-x64",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}
9 changes: 9 additions & 0 deletions .vscode/debug.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
env <- Sys.getenv()
envnames <- names(env)
rnames <- envnames[startsWith(envnames, "R_")]
cached_names <- rnames
ld_lib_path <- Sys.getenv("LD_LIBRARY_PATH")
if (ld_lib_path != "") {
cached_names <- c("LD_LIBRARY_PATH", rnames)
}
writeLines(paste0(cached_names, "=", env[cached_names]), ".vscode/.env")
45 changes: 45 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug RCPP",
"type": "cppdbg",
"request": "launch",
"program": "/usr/lib/R/bin/exec/R",
"args": [
"--vanilla",
"-e",
"devtools::test()"
],
"stopAtEntry": false,
"envFile": "${workspaceFolder}/.vscode/.env",
"cwd": "${workspaceFolder}",
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "debug",
"osx": {
"program": "/Library/Frameworks/R.framework/Resources/bin/exec/R",
"MIMode": "lldb"
}
},
{
"type": "R-Debugger",
"name": "Debug R-Package",
"request": "launch",
"debugMode": "workspace",
"workingDirectory": "${workspaceFolder}",
"loadPackages": [
"."
],
"includePackageScopes": true,
"allowGlobalDebugging": true
}
]
}
Loading

0 comments on commit 323ec74

Please sign in to comment.