Skip to content

Commit

Permalink
Merge pull request #9 from nlmixr2/update-ci
Browse files Browse the repository at this point in the history
Update continuous integration
  • Loading branch information
mattfidler authored Feb 1, 2023
2 parents bc20dca + 6ecf412 commit 92a2901
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 128 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ dparser.*\.(zip|pdf)$
^tests/testthat/g47.test.g$
^tests/testthat/g48.test.g$
^tests/testthat/python.test.g$
^_pkgdown\.yml$
^docs$
^pkgdown$
21 changes: 5 additions & 16 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,15 @@ jobs:
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'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
_R_CHECK_FORCE_SUGGESTS_: false
R_KEEP_PKG_SOURCE: yes

steps:
- name: Install deps on MacOS
if: runner.os == 'macOS'
run: |
brew install --cask xquartz
brew install cairo
brew install udunits
shell: bash

- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2
Expand All @@ -50,9 +41,7 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
pak-version: devel
extra-packages: |
any::rcmdcheck
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
Expand Down
58 changes: 0 additions & 58 deletions .github/workflows/covr.yaml

This file was deleted.

60 changes: 29 additions & 31 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,46 @@
# 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
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: macOS-latest
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: actions/checkout@v3

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

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

- 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}
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Restore R package cache
uses: actions/cache@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
extra-packages: any::pkgdown, local::.
needs: website

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
install.packages("pkgdown", type = "binary")
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Install package
run: R CMD INSTALL .

- name: Deploy package
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
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
50 changes: 50 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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]
pull_request:
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

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

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ inst/doc
/src/.Rhistory
/src/dparser/.*
*.so
docs
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Depends:
R (>= 3.3)
License: BSD_3_clause + file LICENSE
BugReports: https://github.com/nlmixr2/dparser-R/issues/
URL: https://nlmixr2.github.io/dparser-R/, https://github.com/nlmixr2/dparser-R/
URL: https://nlmixr2.github.io/dparser-R/,
https://github.com/nlmixr2/dparser-R/
Encoding: UTF-8
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
6 changes: 4 additions & 2 deletions Readme.Rmd
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
output: github_document
---
[![R-CMD-check](https://github.com/nlmixr2/dparser-R/workflows/R-CMD-check/badge.svg)](https://github.com/nlmixr2/dparser-R/actions)
[![Codecov test coverage](https://codecov.io/gh/nlmixr2/dparser-R/branch/master/graph/badge.svg)](https://codecov.io/gh/nlmixr2/dparser-R?branch=master)
<!-- badges: start -->
[![R-CMD-check](https://github.com/nlmixr2/dparser-R/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/nlmixr2/dparser-R/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/nlmixr2/dparser-R/branch/main/graph/badge.svg)](https://app.codecov.io/gh/nlmixr2/dparser-R?branch=main)
[![CRAN version](http://www.r-pkg.org/badges/version/dparser)](https://cran.r-project.org/package=dparser)
[![cran checks](https://badges.cranchecks.info/summary/dparser.svg)](https://cran.r-project.org/web/checks/check_results_dparser.html)
![r-universe](https://nlmixr2.r-universe.dev/badges/dparser)
<!-- badges: end -->

The R version of dparser is meant to be used as a package library
where you link the C parser to an arbitrary grammer parsed in R. This
Expand Down
33 changes: 18 additions & 15 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@

[![R-CMD-check](https://github.com/nlmixr2/dparser-R/workflows/R-CMD-check/badge.svg)](https://github.com/nlmixr2/dparser-R/actions)
<!-- badges: start -->

[![R-CMD-check](https://github.com/nlmixr2/dparser-R/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/nlmixr2/dparser-R/actions/workflows/R-CMD-check.yaml)
[![Codecov test
coverage](https://codecov.io/gh/nlmixr2/dparser-R/branch/master/graph/badge.svg)](https://codecov.io/gh/nlmixr2/dparser-R?branch=master)
coverage](https://codecov.io/gh/nlmixr2/dparser-R/branch/main/graph/badge.svg)](https://app.codecov.io/gh/nlmixr2/dparser-R?branch=main)
[![CRAN
version](http://www.r-pkg.org/badges/version/dparser)](https://cran.r-project.org/package=dparser)
[![cran
checks](https://badges.cranchecks.info/summary/dparser.svg)](https://cran.r-project.org/web/checks/check_results_dparser.html)
![r-universe](https://nlmixr2.r-universe.dev/badges/dparser)
<!-- badges: end -->

The R version of dparser is meant to be used as a package library where
you link the C parser to an arbitrary grammer parsed in R. This is what
Expand All @@ -17,22 +20,22 @@ is used in `rxode2()`
There are a few differences between the R dparser port and the standard
dparser:

- The R version uses R memory managment instead of C’s memory
managment i.e. `malloc`
- The R version uses R memory managment instead of C’s memory managment
i.e. `malloc`

- The R version is never called from the command line, so all command
line interface is removed `arg.c`
- The R version is never called from the command line, so all command
line interface is removed `arg.c`

- The R version doesn’t exit from the command (killing R), but errors
out in R.
- The R version doesn’t exit from the command (killing R), but errors
out in R.

- All outputs are using R’s output interface instead of printing to
`stdout`, or `stderr`.
- All outputs are using R’s output interface instead of printing to
`stdout`, or `stderr`.

- Some convience functions are added to translate (and maybe parse)
grammers within R.
- Some convience functions are added to translate (and maybe parse)
grammers within R.

- There is currently some fixes for un-sanitized behaviors that are
not in the upstream dparser
- There is currently some fixes for un-sanitized behaviors that are not
in the upstream dparser

- Currently there isn’t an interface to use binary grammars
- Currently there isn’t an interface to use binary grammars
4 changes: 4 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
url: https://nlmixr2.github.io/dparser-R/
template:
bootstrap: 5

4 changes: 0 additions & 4 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@




comment: false

coverage:
Expand Down

0 comments on commit 92a2901

Please sign in to comment.