Skip to content

Commit

Permalink
Update run-r-script.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rikivillalba authored Dec 2, 2024
1 parent 8368883 commit 66fdd2d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/run-r-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ jobs:

steps:
- name: Checkout repository
# Esta acción también descarga demanda_diaria_GBA.txt y demanda_diaria_Edesur.txt del repo.
# versiones predeterminadas.
uses: actions/checkout@v3
- name: Install deps
run: sudo apt install libcurl4-openssl-dev
run: sudo apt-get install libcurl4-openssl-dev
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -38,25 +40,21 @@ jobs:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ env.OS_VERSION }}-${{ env.R_VERSION }}-${{ inputs.cache-version }}-${{ hashFiles('renv.lock') }}
restore-keys: ${{ env.OS_VERSION }}-${{ env.R_VERSION }}-${{ inputs.cache-version }}-
- name: Install R packages if not cached
# Rscript -e 'packages <- c("data.table", "httr", "ggplot2", "jsonlite"); installed <- rownames(installed.packages()); to_install <- setdiff(packages, installed); if (length(to_install) > 0) install.packages(to_install, repos="https://cloud.r-project.org")'
run: |
install.packages(c("httr", "ggplot2", "jsonlite", "data.table"));
- name: Install R packages (or pull from cache)
run: install.packages(c("httr", "ggplot2", "jsonlite", "data.table"));
shell: Rscript {0}
- name: Cache data files
uses: actions/cache@v4
uses: actions/cache/restore@v4
with:
path: |
demanda_diaria_Edesur.txt
demanda_diaria_GBA.txt
key: ${{ runner.os }}-data
# key: ${{ runner.os }}-data-${{ hashFiles('demanda_diaria_Edesur.txt', 'demanda_diaria_GBA.txt') }}
restore-keys: ${{ runner.os }}-data

- name: Run R script
run: |
Rscript demanda_diaria_API_MEM.R
- name: Cache updated data files
uses: actions/cache/save@v4
with:
Expand Down

0 comments on commit 66fdd2d

Please sign in to comment.