-
Notifications
You must be signed in to change notification settings - Fork 3
Description
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 anenvironmentinput (dev,test, orprod; 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
environmentto 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.
- Uses selected
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:
prodenvironment. - 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, orprodenvironment. - Checks out filtered R repository & infrastructure repo, runs custom deploy scripts using secure credentials.
- Deploys validated R image to the requested
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.ymlenables 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.