Skip to content

CI/CD use case: GitHub Actions automating every step from environment setup to report generation and deployment. #77

@Zhenglei-BCS

Description

@Zhenglei-BCS

It is beneficial to implement a streamlined CI/CD workflow that automates the process of building a validated R environment using val.xxx packages. This workflow should consume a curated list of 200 primary R packages (plus their dependencies), automatically validate each through the val.xxx family, and produce detailed validation reports. The workflow must halt immediately if any package fails its required validation criteria—listing the problematic packages and stopping the image build—otherwise, if all pass, it continues to generate reports and complete the deployment. This approach simplifies continuous qualification, traceability, and deployment of R packages for GxP (GLP)-compliance.

Providing an example GitHub Actions workflow file (ci.yml) accelerates adoption and reproducibility by enabling secure, repeatable builds of validated R images in base environments (dev, test, prod), leveraging a structured set of validation and compliance stages.


Workflow Triggers & Configuration

  • Trigger: Manually (workflow_dispatch), accepting an environment input (dev, test, or prod; default: test), and a list of R packages.
  • Permissions: Grants OIDC token and repo read permissions.
  • Environment Variables: e.g., aws-region.

Workflow Stages

1. set-environment

  • Runner: (e.g., external-k8s-v2)
  • Purpose:
    • Uses selected environment to set up corresponding base R infrastructure.
    • Checks out the infrastructure code (company/infrastructure) using environment-appropriate branches and tokens.
    • Installs foundational dependencies and prepares base R environment.

2. scan-and-validate-packages

  • Purpose:
    • Accepts the user-supplied list (typically 200) of R packages.
    • Resolves all dependencies.
    • Iteratively validates every primary package (and all dependencies if requested) with the val.meter and val.criterion validation checks.
    • If all packages pass: continues with workflow and report generation.
    • If any fail: immediately stops build, reports failing packages, and skips downstream steps (no image build).

3. quality-gate (conditional for prod)

  • Runs only for: prod environment.
  • Purpose:
    • Enforces additional organizational gates (e.g., external validation, management sign-off).

4. build-image

  • Depends on: Validation success.
  • Purpose:
    • Builds/assembles validated R environment image.
    • Utilizes infrastructure code and triggers build actions as appropriate.
    • Passes AWS/Vault authentication for secure artifact access.

5. security-testing

  • Purpose:
    • Conducts company customized security checks, ensuring compliance.

6. generate-validation-reports

  • Purpose:
    • Automatically generates and collates validation reports for all selected/main packages (and their dependencies) via val.reports family modules.
    • Collates results for audit and downstream review.

7. deploy

  • Purpose:
    • Deploys validated R image to the requested dev, test, or prod environment.
    • Checks out filtered R repository & infrastructure repo, runs custom deploy scripts using secure credentials.

Adoption Value

  • Early termination on failure: Workflow stops and provides detailed feedback when any package fails, saving compute resources and time.
  • One-click reproducibility: Supplied ci.yml enables teams to quickly adopt and customize the validation pipeline in their own repos.
  • Automated traceability & compliance: Full audit and validation reporting for main and transitive dependencies ensures regulatory confidence.
  • Easily extensible: Straightforward adaptation for new packages or environments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions