Adds v1.1 models for CBEI #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |