-
Notifications
You must be signed in to change notification settings - Fork 30
60 lines (51 loc) · 1.65 KB
/
validate-submission.yaml
File metadata and controls
60 lines (51 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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:
- uses: actions/checkout@v6
- 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@v47
with:
path: model-output
dir_names: "true"
- name: "check output dirs modified"
run: |
if [ "${{ steps.get_changed_files_in_model_output.outputs.all_modified_files }}" == "CovidHub-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}