hubverse-org / hubAdmin

Utilities for administering hubverse Infectious Disease Modeling Hubs
https://hubverse-org.github.io/hubAdmin/
Other
1 stars 2 forks source link

add `ci_validate_hub_config()` function #37

Closed zkamvar closed 2 months ago

zkamvar commented 2 months ago

This adds the exported function ci_validate_hub_config(). It will replace 24 lines of R code embedded in YAML with a single call: hubAdmin::ci_validate_hub_config().

It will not show up in the default user manual because I've added the internal keyword to its documentation.

This will fix #31

The new steps for the validate-config action would look like this:

     - uses: actions/checkout@v4
     - uses: r-lib/actions/setup-r@v2
       with:
         install-r: false
         use-public-rspm: true
         extra-repositories: 'https://hubverse-org.r-universe.dev'
     - uses: r-lib/actions/setup-r-dependencies@v2
       with:
         cache: 'always'
         packages: |
           any::hubAdmin
           any::sessioninfo
     - name: Run validations
       id: validate
       run: hubAdmin::ci_validate_config()
       shell: Rscript {0}
     - name: "Comment on PR"
       id: comment-diff
       if: ${{ github.event_name != 'workflow_dispatch' }}
       uses: carpentries/actions/comment-diff@main
       with:
         pr: ${{ env.PR_NUMBER }}
         path: ${{ env.HUB_PATH }}/diff.md
     - name: Error on Failure
       if: ${{ steps.validate.outputs.result == 'false' }}
       run: |
         echo "::error title=Invalid Configuration::Errors were detected in one or more config files in 'hub-config/'"
         exit 1
github-actions[bot] commented 2 months ago

🚀 Deployed on https://66cdf0cf3bf9842f8c18551e--hubadmin-pr-previews.netlify.app

zkamvar commented 2 months ago

Ready for your review, @annakrystalli, but I have no clue why the lintr is getting angry with me.... it's valid tidyverse style and I can't reproduce the error on my machine.