Setup workflows #3
Workflow file for this run
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: Simple workflow | |
on: | |
push: | |
branches: | |
- main | |
# TODO update this | |
- setup-workflows | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
branches: | |
- main | |
env: | |
ENABLED_STEPS: "checkout_repository,get_package_name,build_r_package,run_r_cmd_check" | |
jobs: | |
hello-world: | |
runs-on: ubuntu-latest | |
container: | |
image: rocker/r-ubuntu:latest | |
steps: | |
- name: Checkout repo 🛎 | |
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 | |
- 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 |