Deploy to by @Chipdelmal #4
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: model-output | |
run-name: Deploy to ${{ inputs.deploy_target }} by @${{ github.actor }} | |
on: | |
push: | |
branches: ['main'] | |
paths: ['model-output/**'] | |
pull_request: | |
branches: ['main'] | |
paths: ['model-output/**'] | |
workflow_dispatch: | |
jobs: | |
validate-submission: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
install-r: false | |
use-public-rspm: true | |
- name: Update R | |
run: | | |
sudo apt-get update | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
packages: Infectious-Disease-Modeling-Hubs/hubValidations, any::sessioninfo | |
- name: Run validations | |
env: | |
PR_NUMBER: ${{ github.event.number }} | |
run: | | |
library("hubValidations") | |
# Get all filepaths for submissions and sort by date | |
details = file.info(list.files( | |
path="./model-output", pattern="*-*-*.csv", recursive=TRUE | |
)) | |
details = details[with(details, order(as.POSIXct(mtime))), ] | |
# Get filenames and iterate through them | |
cFiles = rownames(details) | |
sapply(cFiles, hubValidations::validate_submission, hub_path='.') | |
shell: Rscript {0} |