-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (45 loc) · 1.72 KB
/
test-examples.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
name: Test example scripts
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]
workflow_dispatch: # allow manual trigger
jobs:
build:
runs-on: ubuntu-latest
name: test-examples
strategy:
fail-fast: false
env:
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v4
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
- name: Install packages and render Rmarkdown files
run: |
echo "Rendering the page..."
Rscript -e 'install.packages(c("knitr", "rmarkdown", "kableExtra", "officedown", "pak"))'
Rscript -e 'rmarkdown::render(input = "examples/DownloadandSaveModelLocally.Rmd",
params = list(model = "v1.0", state = "AR", year = 2020))'
Rscript -e 'rmarkdown::render(input = "examples/Demo-Multipliers-CO.Rmd")'
Rscript -e 'rmarkdown::render(input = "examples/BuildandSaveModelsLocally.Rmd",
params = list(model = "v1.1-GHG", states = "CT",
years = c(2017, 2018, 2019, 2020)))'
Rscript -e 'rmarkdown::render(input = "examples/CalculateStateCBE.Rmd",
params = list(model = "v1.1-GHG", state = "CT",
years = c(2017, 2018, 2019, 2020)))'
- name: Upload results
if: always()
uses: actions/upload-artifact@main
with:
name: example_files
path: |
examples/*.md
examples/*.docx