-
Notifications
You must be signed in to change notification settings - Fork 26
67 lines (55 loc) · 1.86 KB
/
generate-2R-model.yaml
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
61
62
63
64
65
66
67
# Generate two-region model objects for all 50 states
name: Generate two-region models
on:
workflow_dispatch: # allow manual trigger
inputs:
model:
description: "Model"
required: true
default: "GAEEIOv1.0-s-WAT-12"
jobs:
build:
runs-on: ubuntu-latest
name: two-region model
strategy:
fail-fast: false
env:
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: release
use-public-rspm: true
- uses: r-lib/actions/setup-renv@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: devtools
- name: Build and validate models - ${{ github.event.inputs.model }}
if: always()
run: |
require(devtools)
devtools::load_all()
model <- "${{ github.event.inputs.model }}"
m <- useeior::buildTwoRegionModels(modelname=model, validate=TRUE)
path <- file.path(rappdirs::user_data_dir(), 'useeior')
dir.create(path, showWarnings=FALSE, recursive=TRUE)
saveRDS(m, file.path(path, paste0(model, '-allstates.rds')))
shell: Rscript {0}
- name: Upload check results
if: failure() # if any of the previous steps fail, export a log
uses: actions/upload-artifact@main
with:
name: results
path: check
- name: Upload files
if: always()
uses: actions/[email protected]
with:
name: "${{ github.event.inputs.model }}"
path: | # uses local user data dir for ubuntu
~/.local/share/useeior/*
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`