Configure GitHub Actions CI/CD for R packages including R CMD check on multiple platforms, test coverage reporting, and pkgdown site deployment. Uses r-lib/actions for standard workflows. Use when setting up CI/CD for a new R package, adding multi-platform testing to an existing package, configuring automated pkgdown site deployment, or adding code coverage reporting to a repository.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
Instruções da origem · Visualização somente leitura
name
setup-github-actions-ci
locale
caveman
source_locale
en
source_commit
82c77053
translator
Julius Brussee homage — caveman
translation_date
2026-04-19
description
Configure GitHub Actions CI/CD for R packages including R CMD check on multiple platforms, test coverage reporting, and pkgdown site deployment. Uses r-lib/actions for standard workflows. Use when setting up CI/CD for a new R package, adding multi-platform testing to an existing package, configuring automated pkgdown site deployment, or adding code coverage reporting to a repository.
Expected: Workflow file .github/workflows/R-CMD-check.yaml created with a multi-platform matrix (macOS, Windows, Ubuntu) covering release, devel, and oldrel.
On failure: If the .github/workflows/ directory does not exist, create it with mkdir -p .github/workflows. Verify YAML syntax with a YAML linter.
Expected: Workflow file .github/workflows/pkgdown.yaml created. Site builds and deploys to gh-pages branch on push to main or release.
On failure: If deployment fails, ensure the repository has contents: write permissions enabled. Verify _pkgdown.yml has development: mode: release set.
Expected: README displays a live CI status badge that updates automatically after each workflow run.
On failure: If the badge shows "no status," verify the workflow filename in the badge URL matches the actual file. Push a commit to trigger the first workflow run.
Step 5: Configure GitHub Repository Settings
Enable GitHub Pages (Settings > Pages) pointing to gh-pages branch if using pkgdown
Add CODECOV_TOKEN secret if using coverage reporting
Ensure GITHUB_TOKEN has appropriate permissions
Expected: GitHub Pages is configured for pkgdown deployment. Required secrets are set. Token permissions are sufficient for the workflows.
On failure: If Pages deployment fails, check Settings > Pages to ensure the source is set to the gh-pages branch. If secrets are missing, add them under Settings > Secrets and variables > Actions.
Check the Actions tab on GitHub to verify workflows run successfully.
Expected: Green checkmarks on all jobs in the GitHub Actions tab. Workflows trigger on both push and PR events.
On failure: Check workflow logs in the Actions tab. Common issues: missing system dependencies (add to extra-packages), vignette build failures (ensure pandoc setup step is present), YAML syntax errors.
Validation
R CMD check passes on all matrix platforms
Coverage report generates (if configured)
pkgdown site deploys (if configured)
Status badge shows in README
Workflows trigger on both push and PR
Common Pitfalls
Missing permissions: GitHub Actions now requires explicit permissions. Add permissions: read-all at minimum
System dependencies: Some R packages need system libraries. Use r-lib/actions/setup-r-dependencies which handles most cases
Vignettes without pandoc: Always include r-lib/actions/setup-pandoc@v2
pkgdown development mode: Ensure _pkgdown.yml has development: mode: release for GitHub Pages