Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
refresh-ccw

GitHub Action

R minimum dependency check

v0.1.0

R minimum dependency check

refresh-ccw

R minimum dependency check

Derieve minimum version of package dependencies, install and execute R CMD CHECK

Installation

Copy and paste the following snippet into your .yml file.

              

- name: R minimum dependency check

uses: insightsengineering/[email protected]

Learn more about this action in insightsengineering/r-verdepcheck-action

Choose a version

R Minimum Dependency Check Action

Description

Resolve and install minimal dependencies for a given package. Execute R CMD CHECK with minimal dependencies installed. The aim is to check correctness of a DESCRIPTION file, i.e. minimal dependencies specification. This covers only direct dependencies, i.e. it does not resolve dependencies of dependencies recursively.

Example:

flowchart LR
    A-- imports -->B;
    B-- imports -->C;
Loading

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

Initial assessment of recursive functionality oftentimes leads to install compilation error of very old packages, errors in historical package releases that are not valid anymore or install requests of archived and not maintained packages. It's hard to decide what to do with it.

The functionality relies heavily on pkgdepends::new_pkg_installation_proposal and its dependency resolving mechanism.

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

  • 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: ""

  • additional-env-vars:

    Description: Additional environment variables.

    Required: false

    Default: ""

Outputs

None

Usage

name: Minimum dependency check

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

jobs:
  check:
    runs-on: ubuntu-latest
    name: Minimum dependency check
    container:
      image: rocker/tidyverse:4.1.2

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

      - name: Run dependency check
        uses: insightsengineering/r-mindepscheck-action@v1
        with:
          github-token: ${{ secrets.REPO_GITHUB_TOKEN }}

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