Skip to content

Update simple.yaml

Update simple.yaml #11

---
name: Check 🐳
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- main
push:
branches:
- main
# This reusable workflow from insightsengineering/r.pkg.template will run once a PR to main branch is created.
jobs:
r-cmd-with-docker:
name: R CMD Check 🧬 - Inside container 🐳
runs-on: ubuntu-latest
container:
image: "ghcr.io/user-workshop-cicd/r-pkg-example:4.3"
if: false
steps:
# Note : We can not use reusable workflow when the job runs on a container. Only Github Actions can be used.
- name: Checkout repo
uses: actions/[email protected]
with:
path: ${{ github.event.repository.name }}
- name: Get package name πŸ“¦
id: package-name
run: |
PKGBUILD="$(Rscript -e 'cat(sprintf("%s_%s.tar.gz",(dcf <- read.dcf("DESCRIPTION"))[,"Package"], dcf[,"Version"]))')"
echo "PKGBUILD = $PKGBUILD"
echo "pkgbuild=$PKGBUILD" >> $GITHUB_OUTPUT
shell: bash
working-directory: ${{ github.event.repository.name }}
# Print dependencies
- name: Print deps
run: |
cat("Let's print installed dependencies:\n")
installed.packages()
shell: Rscript {0}
# Build a package stored in a directory called ${{ github.event.repository.name }}
# --no-manual --no-build-vignettes because this requires LaTeX.
- name: Build R package πŸ—
run: |
R CMD build --no-manual --no-build-vignettes ${{ github.event.repository.name }}
shell: bash
# Check `.tar.gz` package built in previous step.
# --no-manual --no-vignettes because this requires LaTeX.
- name: Check R package 🏁
run: |
echo "Let's run R CMD check..."
R CMD check --no-manual --no-build-vignettes ${{ steps.package-name.outputs.pkgbuild }}
shell: bash