All SticsRPacks repositories use GitHub Actions for checks, coverage, documentation, and integration testing.
The package repositories (CroPlotR, CroptimizR, SticsRFiles, SticsOnR, SticsRPacks) now use the followin main CI workflows:
-
check-standard.yaml- Runs the standard
R-CMD-check. - Triggered on
pushtomainormaster. - This is the workflow used for the README badge, so it stays independent from integration tests.
- Runs the standard
-
pr-checks.yaml- Triggered on
pull_request. - Runs:
R-CMD-check- integration tests with the other packages at
main - integration tests with the other packages at
release
- The integration jobs depend on the success of
R-CMD-check. - Because this workflow is PR-triggered, the integration checks are visible directly from the PR page.
- Triggered on
-
integration-tests.yaml- Triggered automatically after a successful
R-CMD-checkonpushtomainormaster. - Also supports manual
workflow_dispatch. - On post-merge runs, only the
releaseintegration mode is executed. - On manual runs, the workflow also lets us choose the
SticsRTestsref to use.
- Triggered automatically after a successful
-
dependabot.yml- Checks if any new version exists for the GitHub actions used in this repository, and make a PR if it finds one.
Other workflows remain repository-specific:
style.yaml: style checks and optional auto-formatting.test-coverage.yaml: test coverage reporting.pkgdown.yaml: documentation website deployment.update-citation-cff.yaml: update of citation metadata.vdiffr.yaml: visual snapshot regression checks forCroPlotR. It sets up an R environment, installs necessary dependencies, and generates snapshots from the latest commit on the current branch and on the main branch to compare visual outputs and ensure they remain consistent over time.
Integration tests are run using a reusable workflow:
SticsRTests/.github/workflows/integration-tests.yaml
Each package repository calls it with:
- the repository under test
- the branch or SHA of the package under test
- a dependency mode for the other packages:
mainorrelease - optionally, a
SticsRTestsbranch/tag/SHA for manual runs
The reusable workflow:
- checks out
SticsRTests - resolves which refs to use for:
SticsRPacksSticsRFilesSticsOnRCroptimizRCroPlotR
- installs the selected component packages and their dependencies
- installs
SticsRPacksafterwards withdependencies = FALSE - prints the selected refs and installed versions
- runs
testthat::test_local()fromSticsRTests
This ordering is important:
- the component packages are installed first so the tested branch or SHA is respected
SticsRPacksis installed afterwards withdependencies = FALSEso it does not reinstall packages from its ownRemotes
The CI now uses r-lib/actions/setup-r-dependencies@v2 wherever possible.
Two patterns are used:
-
Standard package checks
setup-r-dependenciesinstalls the package dependencies and caches them.- In
SticsRTests, the workflow also readsSticsRPacks/DESCRIPTIONso that CRAN dependencies required bySticsRPacksare installed too. SticsRPacksitself is then installed separately withdependencies = FALSE.
-
Integration tests
setup-r-dependenciesinstalls:- CRAN dependencies from
SticsRTests - CRAN dependencies from the selected
SticsRPacksref - the selected GitHub refs for
SticsRFiles,SticsOnR,CroptimizR, andCroPlotR
- CRAN dependencies from
SticsRPacksis then installed separately withdependencies = FALSE
This keeps the dependency cache useful while avoiding ref conflicts between main and release.
Each package repository has a manual integration workflow dispatch:
- open the
integration-testsworkflow in the GitHub Actions tab - click
Run workflow - choose the branch of the package repository to run from
- optionally set
sticsrtests_refto a branch, tag, or SHA ofSticsRTests
This is useful when validating a branch of SticsRTests without merging it first.
act can be used to run some GitHub Actions workflows locally with Docker.
Important points:
- run
actfrom the repository you want to test - many of our workflows are not triggered by
push, so you usually need to specify the event explicitly - for Apple Silicon, use
--container-architecture=linux/amd64
From a package repository:
act -lExample local run:
act workflow_dispatch \
-W .github/workflows/integration-tests.yaml \
-j integration-tests \
--input dependency_mode=main \
--input sticsrtests_ref=mainThis will run the integration-tests job from the integration-tests.yaml workflow, with the main branch of SticsRTests and the main branches of our packages as dependencies. It will of course use the local branch of the package repository as the tested ref.