Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/insightsengineering/r-verdepcheck-action

Github Action to check if R package works correctly with minimum version of dependencies installed
https://github.com/insightsengineering/r-verdepcheck-action

actions github-actions r

Last synced: 9 days ago
JSON representation

Github Action to check if R package works correctly with minimum version of dependencies installed

Awesome Lists containing this project

README

        

# R Version Dependency Check Action

## Description

Execute R CMD CHECK using various strategies of package dependencies versions.
The aim is to check correctness of a `DESCRIPTION` file, i.e. minimal version of dependencies.
This covers only _direct_ dependencies, i.e. it does not resolve dependencies of dependencies recursively.

Example:
```mermaid
flowchart LR
A-- imports -->B;
B-- imports -->C;
```

When executed for A, script would read A's `DESCRIPTION` file, determine version of B and install it using latest version of C (i.e. base package installation).

Please see [`verdepcheck`](https://github.com/insightsengineering/verdepcheck) package documentation for details.

## Action type
Composite

## Author
Insights Engineering

## Inputs
* `github-token`:

_Description_: Token with permissions to clone repositories with dependencies.

_Required_: `false`

_Default_: `""`

* `repository-path`:

_Description_: Directory where the checked package has been cloned.

_Required_: `false`

_Default_: `repository`

* `extra-deps`:

_Description_: Extra dependencies specified similarly as in the `DESCRIPTION` file, i.e. `" ( )"` where both `` and `` are optional. Multiple entries are possible separated by `";"`.

_Required_: `false`

_Default_: `""`

* `check-args`:

_Description_: Optional value of `args` argument to `rcmdcheck::rcmdcheck` in form of a string with space as delimeter, e.g. `"--no-examples --no-tests"`.

_Required_: `false`

_Default_: `""`

* `build-args`:

_Description_: Optional value of `build_args` argument to `rcmdcheck::rcmdcheck` in form of a string with space as delimeter, e.g. `"--force --keep-empty-dirs"`.

_Required_: `false`

_Default_: `""`

* `strategy`:

_Description_: Strategy for dependency test, should be one of: min, release, max.

_Required_: `true`

* `additional-env-vars`:

_Description_: Additional environment variables.

_Required_: `false`

_Default_: `""`

## Outputs

None

## Usage

```yaml
name: Dependency Test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
check:
runs-on: ubuntu-latest
name: Dependency Test
container:
image: rocker/tidyverse:4.4.1

steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
path: repository

- name: Run Dependency Test
uses: insightsengineering/r-verdepcheck-action@latest
with:
github-token: ${{ secrets.REPO_GITHUB_TOKEN }}
strategy: release

- name: Upload lock file
if: always()
uses: actions/upload-artifact@v3
with:
name: lock-file
path: pkg.lock
```