Skip to content

Commit

Permalink
start ci and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed May 1, 2024
1 parent ce31210 commit 84c595a
Show file tree
Hide file tree
Showing 15 changed files with 722 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
66 changes: 66 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# 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
pull_request:
branches: main

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: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}

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

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

- 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:
pak-version: devel
extra-packages: |
any::rcmdcheck
nlmixr2/lotri
nlmixr2/dparser-R
nlmixr2/rxode2ll
nlmixr2/rxode2parse
nlmixr2/rxode2random
nlmixr2/rxode2et
nlmixr2/rxode2
needs: check
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
62 changes: 62 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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]
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@v3

- 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
nlmixr2/lotri
nlmixr2/dparser-R
nlmixr2/rxode2ll
nlmixr2/rxode2parse
nlmixr2/rxode2random
nlmixr2/rxode2et
nlmixr2/rxode2
nlmixr2/nlmixr2est
nlmixr2/nlmixr2extra
nlmixr2/nlmixr2plot
nlmixr2/nlmixr2
nlmixr2/babelmixr2
nlmixr2/nlmixr2rpt
lixoftConnectors=?ignore
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
59 changes: 59 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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:
pak-version: devel
extra-packages: |
any::covr
nlmixr2/lotri
nlmixr2/dparser-R
nlmixr2/rxode2ll
nlmixr2/rxode2parse
nlmixr2/rxode2random
nlmixr2/rxode2et
nlmixr2/rxode2
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
37 changes: 35 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ knitr::opts_chunk$set(
# monolix2rx <img src="man/figures/logo.png" align="right" height="138" alt="" />

<!-- badges: start -->
[![R-CMD-check](https://github.com/nlmixr2/monolix2rx/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/nlmixr2/monolix2rx/actions/workflows/R-CMD-check.yaml)
[![Codecov test
coverage](https://codecov.io/gh/nlmixr2/monolix2rx/branch/main/graph/badge.svg)](https://app.codecov.io/gh/nlmixr2/monolix2rx?branch=main)
[![CRAN
version](http://www.r-pkg.org/badges/version/monolix2rx)](https://cran.r-project.org/package=monolix2rx)
[![CRAN total
downloads](https://cranlogs.r-pkg.org/badges/grand-total/monolix2rx)](https://cran.r-project.org/package=monolix2rx)
[![CRAN total
downloads](https://cranlogs.r-pkg.org/badges/monolix2rx)](https://cran.r-project.org/package=monolix2rx)
[![CodeFactor](https://www.codefactor.io/repository/github/nlmixr2/monolix2rx/badge)](https://www.codefactor.io/repository/github/nlmixr2/monolix2rx)
![r-universe](https://nlmixr2.r-universe.dev/badges/monolix2rx)
<!-- badges: end -->

The goal of monolix2rx is to convert `Monolix` to `rxode2` to use for
Expand All @@ -33,11 +44,33 @@ devtools::install_github("nlmixr2/monolix2rx")

## Example

This is a basic example which shows you how to solve a common problem:
If you are trying to convert a Monolix to a rxode2 model you simply
need the path to the `mlxtran` file. For example, the classic demo of
theophylline is included in `monolix2rx` and can be imported below:

```{r example}
library(monolix2rx)
## basic example code
# First load in the model; in this case the theo model
# This is modified from the Monolix demos by saving the model
# file as a text file (hence you can access without model library).
# Additionally some of the file paths were shortened so they could
# be included with monolix2rx
pkgTheo <- system.file("theo", package="monolix2rx")
mlxtranFile <- file.path(pkgTheo, "theophylline_project.mlxtran")
rx <- monolix2rx(mlxtranFile)
rx
# If you are only interseted in the parsing you can use `mlxtran`
mlx <- mlxtran(mlxtranFile)
mlx
# this can be converted to a list
head(as.list(mlx))
```

## Translating models from the Monolix model library
Expand Down
Loading

0 comments on commit 84c595a

Please sign in to comment.