Update simple.yaml #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 |