-
Notifications
You must be signed in to change notification settings - Fork 23
57 lines (47 loc) · 1.8 KB
/
validation.yml
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
name: Validate and Visualize Submission
on:
pull_request_target:
branches:
- main
jobs:
validates-viz-files:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Setup R
uses: r-lib/actions/setup-r@v2
- name: Install system dependencies
run: sudo apt-get install libcurl4-openssl-dev libudunits2-dev libgdal-dev
- name: Cache R packages
id: cache
if: runner.os != 'Windows'
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/requirements.txt') }}-1
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
R -e 'Sys.setenv("NOT_CRAN" = TRUE)
install.packages(c("arrow", "gh", "remotes"))
Sys.unsetenv("NOT_CRAN")
remotes::install_url("https://github.com/midas-network/SMHvalidation/archive/refs/heads/main.zip")
remotes::install_url("https://github.com/Infectious-Disease-Modeling-Hubs/hubUtils/archive/refs/heads/main.zip")'
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
- name: Run Validation
run: |
Rscript code/validation/validation.R
env:
GH_PR_NUMBER: ${{ github.event.pull_request.number }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Projection Plot as Artifact
uses: actions/upload-artifact@v3
if: always()
with:
name: validation_plot_${{ github.event.pull_request.number }}
path: ./proj_plot/*
if-no-files-found: ignore