Skip to content

Update

Update #8

Workflow file for this run

---
name: Simple workflow
on:
push:
branches:
- main
# TODO update this
- setup-workflows
# pull_request:
# types:
# - opened
# - synchronize
# - reopened
# - ready_for_review
# branches:
# - main
# To make sure you can run this workflow in your forked repository, please go to:
# Actions and click I understand my workflows...
# For reference, this is how the full list of steps will look like:
#
#env:
# ENABLED_STEPS: |
# checkout_repository
# get_package_name
# build_r_package
# run_r_cmd_check
# upload_artifact
# Please set this variable to include proper steps.
env:
ENABLED_STEPS: |
checkout_repository
get_package_name
build_r_package
run_r_cmd_check
upload_artifact
jobs:
hello-world:
runs-on: ubuntu-latest
container:
# image: rocker/r-ubuntu:latest
image: rocker/verse:4.4.0
steps:
- name: Checkout repo 🛎
# This means we're actually using a GitHub Action.
uses: actions/[email protected]
if: contains(env.ENABLED_STEPS, 'checkout_repository')
with:
path: ${{ github.event.repository.name }}
- name: Get package name 📦
if: contains(env.ENABLED_STEPS, 'get_package_name')
run: |
PKGBUILD="$(echo $(awk -F: '/Package:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION)_"\
"$(awk -F: '/Version:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION).tar.gz)"
echo "PKGBUILD = $PKGBUILD"
echo "PKGBUILD=$PKGBUILD" >> $GITHUB_ENV
shell: bash
working-directory: ${{ github.event.repository.name }}
- name: Build R package 🏗
if: contains(env.ENABLED_STEPS, 'build_r_package')
run: |
R CMD build ${{ github.event.repository.name }}
shell: bash
# TODO Decide if we use an image with these packages installed,
# or we want to show how to install them (takes 2-3 minutes).
# Additionally, LaTeX is needed to create manual.
# - name: Install packages
# run:
# install.packages(c("cli", "testthat"))
# shell: Rscript {0}
- name: Run R CMD check 🏁
if: contains(env.ENABLED_STEPS, 'run_r_cmd_check')
run: |
R CMD check ${{ env.PKGBUILD }}
shell: bash
env:
_R_CHECK_TESTS_NLINES_: 0
_R_CHECK_VIGNETTES_NLINES_: 0
- name: Upload package build ⤴
if: contains(env.ENABLED_STEPS, 'upload_artifact')
uses: actions/upload-artifact@v4
with:
path: ${{ github.event.repository.name }}/${{ env.PKGBUILD }}
name: ${{ env.PKGBUILD }}