Skip to content

Deploy to by @alotfata #23

Deploy to by @alotfata

Deploy to by @alotfata #23

name: model-metadata
run-name: Deploy to ${{ inputs.deploy_target }} by @${{ github.actor }}
on:
push:
branches: ['main']
paths: ['model-metadata/**', '!**README**']
pull_request:
branches: ['main']
paths: ['model-metadata/**', '!**README**']
workflow_dispatch:
jobs:
validate-models-metadata:
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("hubAdmin")
# Sort by date
details = file.info(list.files(path="./model-metadata", pattern="*.yml"))
details = details[with(details, order(as.POSIXct(mtime))), ]
# Get filenames
cFiles = rownames(details)
# Iterate through files
sapply(cFiles, hubValidations::validate_model_metadata, hub_path='.')
shell: Rscript {0}