From 6ecf412fdf027f352e403ca904e3b6983c17c029 Mon Sep 17 00:00:00 2001 From: Bill Denney Date: Sun, 29 Jan 2023 15:32:07 -0500 Subject: [PATCH] Update continuous integration --- .Rbuildignore | 3 ++ .github/workflows/R-CMD-check.yaml | 21 +++------- .github/workflows/covr.yaml | 58 --------------------------- .github/workflows/pkgdown.yaml | 60 ++++++++++++++-------------- .github/workflows/test-coverage.yaml | 50 +++++++++++++++++++++++ .gitignore | 1 + DESCRIPTION | 5 ++- Readme.Rmd | 6 ++- Readme.md | 33 ++++++++------- _pkgdown.yml | 4 ++ codecov.yml | 4 -- 11 files changed, 117 insertions(+), 128 deletions(-) delete mode 100644 .github/workflows/covr.yaml create mode 100644 .github/workflows/test-coverage.yaml create mode 100644 _pkgdown.yml diff --git a/.Rbuildignore b/.Rbuildignore index 16a47be..73609e8 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -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$ diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 265dbc5..a3ac618 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -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 @@ -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 diff --git a/.github/workflows/covr.yaml b/.github/workflows/covr.yaml deleted file mode 100644 index da8f552..0000000 --- a/.github/workflows/covr.yaml +++ /dev/null @@ -1,58 +0,0 @@ -on: - push: - branches: - - main - - master - pull_request: - branches: - - main - - master - -name: test-coverage - -jobs: - test-coverage: - runs-on: ubuntu-20.04 - env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - RSPM: https://packagemanager.rstudio.com/cran/__linux__/focal/latest - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@v1 - - - uses: r-lib/actions/setup-pandoc@v1 - - - uses: r-lib/actions/setup-tinytex@v1 - - - name: Install packages from cran (source) - run: | - install.packages('remotes') - install.packages("jsonlite", type="source") - install.packages("usethis", type="source") - remotes::install_cran("covr") - shell: Rscript {0} - - - name: Query dependencies - run: | - install.packages('remotes') - shell: Rscript {0} - - - name: Cache R packages - uses: actions/cache@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- - - - name: Install dependencies - run: | - remotes::install_deps(dependencies = TRUE) - shell: Rscript {0} - - - name: Test coverage - run: | - options(covr.flags = c(CFLAGS = "-O0 --coverage", CXXFLAGS = "-O0 --coverage", LDFLAGS = "--coverage")) - pkgbuild::with_build_tools(covr::codecov(quiet=FALSE)) - shell: Rscript {0} diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 1abece4..087f0b0 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -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 "actions@github.com" - 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/github-pages-deploy-action@v4.4.1 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..2c5bb50 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -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 diff --git a/.gitignore b/.gitignore index ae41af6..00efe07 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ inst/doc /src/.Rhistory /src/dparser/.* *.so +docs diff --git a/DESCRIPTION b/DESCRIPTION index c03c074..f7a50e8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 diff --git a/Readme.Rmd b/Readme.Rmd index 187965a..a3b71ce 100644 --- a/Readme.Rmd +++ b/Readme.Rmd @@ -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) + +[![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) + 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 diff --git a/Readme.md b/Readme.md index 0f57750..440b86d 100644 --- a/Readme.md +++ b/Readme.md @@ -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) + + +[![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) + 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 @@ -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 diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..c5e457a --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,4 @@ +url: https://nlmixr2.github.io/dparser-R/ +template: + bootstrap: 5 + diff --git a/codecov.yml b/codecov.yml index 6d521ac..04c5585 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,7 +1,3 @@ - - - - comment: false coverage: