[pre-commit.ci] pre-commit autoupdate #263
This file contains hidden or 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: "Hub Submission Validation (R)" | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: main | |
| jobs: | |
| validate-submission: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: "Checkout Code" | |
| uses: actions/checkout@v5 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| install-r: true | |
| use-public-rspm: true | |
| extra-repositories: 'https://hubverse-org.r-universe.dev' | |
| - name: "Update R" | |
| run: | | |
| sudo apt-get update | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| pak-version: "devel" | |
| packages: | | |
| any::hubValidations | |
| any::sessioninfo | |
| - name: "Get Model Output Changes" | |
| id: get_changed_files_in_model_output | |
| uses: step-security/changed-files@v46 | |
| with: | |
| path: model-output | |
| dir_names: "true" | |
| - name: "Check Modified Output Directories" | |
| run: | | |
| if [ "${{ steps.get_changed_files_in_model_output.outputs.all_modified_files }}" == "RSVHub-ensemble" ]; then | |
| { echo "model=ensemble" | tee -a $GITHUB_ENV; } | |
| else | |
| { echo "model=other" | tee -a $GITHUB_ENV; } | |
| fi | |
| - name: "Run Validations" | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| run: | | |
| library("hubValidations") | |
| v <- hubValidations::validate_pr( | |
| gh_repo = Sys.getenv("GITHUB_REPOSITORY"), | |
| pr_number = Sys.getenv("PR_NUMBER"), | |
| skip_submit_window_check = Sys.getenv("model") == "ensemble" | |
| ) | |
| hubValidations::check_for_errors(v, verbose = TRUE) | |
| shell: Rscript {0} |