From 2e11a815a0a3dfe5f1153f90053e1c36222fa361 Mon Sep 17 00:00:00 2001 From: Ernest Guevarra Date: Sun, 1 Sep 2024 22:01:07 +0100 Subject: [PATCH 1/3] unify targets --- R/pagasa_releases.R | 32 ++++++++++++-------------------- _targets.R | 27 ++++++++++++++++++--------- _targets.yaml | 12 ------------ _targets_climate.R | 8 -------- _targets_cyclones.R | 8 -------- _targets_dam.R | 18 ++++-------------- _targets_heat.R | 22 ++++++---------------- _targets_releases.R | 7 ++----- 8 files changed, 42 insertions(+), 92 deletions(-) delete mode 100644 _targets.yaml diff --git a/R/pagasa_releases.R b/R/pagasa_releases.R index b4f67bf..a7dcddd 100644 --- a/R/pagasa_releases.R +++ b/R/pagasa_releases.R @@ -65,11 +65,7 @@ paglaom_create_weekly_release <- function(repo = "panukatan/paglaom", #' Create data upload to GitHub #' -paglaom_upload_weekly_release <- function(climate_download_files, - cyclone_reports_download_files, - dam_level_data_files, - heat_index_download_files, - repo = "panukatan/paglaom", +paglaom_upload_weekly_release <- function(repo = "panukatan/paglaom", tag) { zipdir <- tempdir() zip_climate <- file.path(zipdir, "climate.zip") @@ -80,36 +76,32 @@ paglaom_upload_weekly_release <- function(climate_download_files, ## zip climate files ---- zip( zip_climate, - # files = list.files( - # path = "data-raw/climate", full.names = TRUE, recursive = TRUE) - files = climate_download_files + files = list.files( + path = "data-raw/climate", full.names = TRUE, recursive = TRUE) ) ## zip cyclones files ---- zip( zip_cyclones, - # files = list.files( - # path = "data-raw/cyclones", full.names = TRUE, recursive = TRUE - # ) - files = cyclone_reports_download_files + files = list.files( + path = "data-raw/cyclones", full.names = TRUE, recursive = TRUE + ) ) ## zip dam files ---- zip( zip_dam, - # files = list.files( - # path = "data-raw/dam", full.names = TRUE, recursive = TRUE - # ) - files = dam_level_data_files + files = list.files( + path = "data-raw/dam", full.names = TRUE, recursive = TRUE + ) ) ## zip heat files ---- zip( zip_heat, - # files = list.files( - # path = "data-raw/heat_index", full.names = TRUE, recursive = TRUE - # ) - files = heat_index_download_files + files = list.files( + path = "data-raw/heat_index", full.names = TRUE, recursive = TRUE + ) ) lapply( diff --git a/_targets.R b/_targets.R index 9d0ebbe..302274b 100644 --- a/_targets.R +++ b/_targets.R @@ -10,16 +10,21 @@ source("_targets_setup.R") ## Create targets and list targets objects ------------------------------------- -### Data targets -data_targets <- tar_plan( - -) +### Cyclones targets ---- +source("_targets_cyclones.R") + + +### Climate targets ---- +source("_targets_climate.R") -### Processing targets -processing_targets <- tar_plan( - -) + +### Dam targets ---- +source("_targets_dam.R") + + +### Heat Index targets ---- +source("_targets_heat.R") ### Analysis targets @@ -46,5 +51,9 @@ deploy_targets <- tar_plan( ) -## List targets +### Releases targets ---- +source("_targets_releases.R") + + +## List targets ---------------------------------------------------------------- all_targets() diff --git a/_targets.yaml b/_targets.yaml deleted file mode 100644 index 9005409..0000000 --- a/_targets.yaml +++ /dev/null @@ -1,12 +0,0 @@ -cyclones: - script: _targets_cyclones.R - store: _targets -heat: - script: _targets_heat.R - store: _targets -climate: - script: _targets_climate.R - store: _targets -dam: - script: _targets_dam.R - store: _targets diff --git a/_targets_climate.R b/_targets_climate.R index 61bb48e..3e22d42 100644 --- a/_targets_climate.R +++ b/_targets_climate.R @@ -4,10 +4,6 @@ # ################################################################################ -## Setup workflow using project-wide settings ---------------------------------- -source("_targets_setup.R") - - ## Download targets ------------------------------------------------------------ download_targets <- tar_plan( @@ -92,7 +88,3 @@ report_targets <- tar_plan( deploy_targets <- tar_plan( ) - - -## List targets ---------------------------------------------------------------- -all_targets() diff --git a/_targets_cyclones.R b/_targets_cyclones.R index 50c54e7..a69444f 100644 --- a/_targets_cyclones.R +++ b/_targets_cyclones.R @@ -4,10 +4,6 @@ # ################################################################################ -## Setup workflow using project-wide settings ---------------------------------- -source("_targets_setup.R") - - ## Download targets ------------------------------------------------------------ download_targets <- tar_plan( @@ -82,7 +78,3 @@ report_targets <- tar_plan( deploy_targets <- tar_plan( ) - - -## List targets ---------------------------------------------------------------- -all_targets() diff --git a/_targets_dam.R b/_targets_dam.R index 9fff4e3..c7f4d92 100644 --- a/_targets_dam.R +++ b/_targets_dam.R @@ -4,13 +4,7 @@ # ################################################################################ -# Setup workflow using project-wide settings ---------------------------------- -source("_targets_setup.R") - - -# Create targets and list targets objects ------------------------------------- - -## Data targets +## Data targets ---------------------------------------------------------------- data_targets <- tar_plan( ### Set PAGASA dam level URL ---- tar_target( @@ -31,7 +25,7 @@ data_targets <- tar_plan( ) -## Processing targets +## Processing targets ---------------------------------------------------------- processing_targets <- tar_plan( ### Processing daily dam level data ---- tar_target( @@ -41,13 +35,13 @@ processing_targets <- tar_plan( ) -## Analysis targets +## Analysis targets ------------------------------------------------------------ analysis_targets <- tar_plan( ) -## Output targets +## Output targets -------------------------------------------------------------- output_targets <- tar_plan( ### Output dam level data as CSV ---- tar_target( @@ -73,7 +67,3 @@ report_targets <- tar_plan( deploy_targets <- tar_plan( ) - - -## List targets -all_targets() diff --git a/_targets_heat.R b/_targets_heat.R index aca19d5..ba7854d 100644 --- a/_targets_heat.R +++ b/_targets_heat.R @@ -4,13 +4,7 @@ # ################################################################################ -## Setup workflow using project-wide settings ---------------------------------- -source("_targets_setup.R") - - -## Create targets and list targets objects ------------------------------------- - -### Data targets +## Data targets ---------------------------------------------------------------- data_targets <- tar_plan( ### Set PAGASA heat index pubfiles URL ---- tar_target( @@ -48,35 +42,31 @@ data_targets <- tar_plan( ) -### Processing targets +## Processing targets ---------------------------------------------------------- processing_targets <- tar_plan( ) -### Analysis targets +## Analysis targets ------------------------------------------------------------ analysis_targets <- tar_plan( ) -### Output targets +## Output targets -------------------------------------------------------------- output_targets <- tar_plan( ) -### Reporting targets +## Reporting targets ----------------------------------------------------------- report_targets <- tar_plan( ) -### Deploy targets +## Deploy targets -------------------------------------------------------------- deploy_targets <- tar_plan( ) - - -## List targets -all_targets() diff --git a/_targets_releases.R b/_targets_releases.R index 2dd4f30..8a81bb2 100644 --- a/_targets_releases.R +++ b/_targets_releases.R @@ -4,10 +4,6 @@ # ################################################################################ -## Setup workflow using project-wide settings ---------------------------------- -source("_targets_setup.R") - - ## Release targets ------------------------------------------------------------- release_targets <- tar_plan( @@ -25,7 +21,8 @@ release_targets <- tar_plan( cyclone_reports_download_files, dam_level_data_files, heat_index_download_files, - tag = paglaom_weekly_release_tag + #tag = paglaom_weekly_release_tag + tag = "1.8.34" ) ) ) From 0074dc6608bf71e73c7a9044c2c3734f2e34746d Mon Sep 17 00:00:00 2001 From: Ernest Guevarra Date: Sun, 1 Sep 2024 22:27:11 +0100 Subject: [PATCH 2/3] unify targets; fix #51 --- .github/workflows/deploy-targets-releases.yml | 8 +- README.Rmd | 76 +++++------------ README.md | 81 +++++-------------- _targets_dam.R | 3 +- _targets_releases.R | 7 +- 5 files changed, 44 insertions(+), 131 deletions(-) diff --git a/.github/workflows/deploy-targets-releases.yml b/.github/workflows/deploy-targets-releases.yml index 35c301f..08d22c9 100644 --- a/.github/workflows/deploy-targets-releases.yml +++ b/.github/workflows/deploy-targets-releases.yml @@ -40,13 +40,13 @@ jobs: - name: Run workflows run: | - targets::tar_make(script = "_targets_climate.R") - targets::tar_make(script = "_targets_cyclones.R") - targets::tar_make(script = "_targets_dam.R") + targets::tar_make(climate_download_files) + targets::tar_make(cyclone_reports_download_files) + targets::tar_make(dam_level_data_raw_csv) shell: Rscript {0} - name: Create weekly data release run: | - targets::tar_make(script = "_targets_releases.R") + targets::tar_make(paglaom_weekly_release) shell: Rscript {0} \ No newline at end of file diff --git a/README.Rmd b/README.Rmd index f04361a..22fe20c 100644 --- a/README.Rmd +++ b/README.Rmd @@ -110,94 +110,57 @@ to install all R package dependencies. Currently, the project has workflows that curate the following datasets: -1. Tropical cyclones data for various cyclones entering the Philippine area of responsibility since 2017 +1. Tropical cyclones data for various cyclones entering the Philippine area of responsibility since 2017; -```{r cyclones_workflow, echo = FALSE, message = FALSE, results = 'asis'} -cat( - "```mermaid", - targets::tar_mermaid( - targets_only = TRUE, color = FALSE, legend = FALSE, - script = "_targets_cyclones.R" - ), - "```", - sep = "\n" -) -``` - - -2. Daily heat index data from various data collection points in the Philippines - -```{r heat_workflow, echo = FALSE, message = FALSE, results = 'asis'} -cat( - "```mermaid", - targets::tar_mermaid( - targets_only = TRUE, color = FALSE, legend = FALSE, - script = "_targets_heat.R" - ), - "```", - sep = "\n" -) -``` +2. Daily heat index data from various data collection points in the Philippines; +3. Climatological extremes and normals data over time; and, -3. Climatological extremes and normals data over time +4. Daily dam water level data. -```{r climate_workflow, echo = FALSE, message = FALSE, results = 'asis'} -cat( - "```mermaid", - targets::tar_mermaid( - targets_only = TRUE, color = FALSE, legend = FALSE, - script = "_targets_climate.R" - ), - "```", - sep = "\n" -) -``` +The following diagram illustrates these workflows - -4. Daily dam water level data - -```{r dam_workflow, echo = FALSE, message = FALSE, results = 'asis'} +```{r overall_workflow, echo = FALSE, message = FALSE, results = 'asis'} cat( "```mermaid", targets::tar_mermaid( - targets_only = TRUE, color = FALSE, legend = FALSE, - script = "_targets_dam.R" + targets_only = TRUE, + names = dplyr::starts_with(c("climate", "cyclone", "dam", "heat")), + color = FALSE, legend = FALSE ), "```", sep = "\n" ) ``` - To run any of these workflows, run the following command on the R console: ```R -targets::tar_make(script = "NAME_OF_TARGET_SCRIPT_R_FILE") +targets::tar_make(dplyr::starts_with("PREFIX")) ``` -replacing `"NAME_OF_TARGET_SCRIPT_R_FILE"` with the name of the target script file for the specific workflow. For example, to run the cyclones workflow from R console: +replacing `"PREFIX"` with the keyword for the type of data. For example, to run the cyclones workflow from R console: ```R -targets::tar_make(script = "_targets_cyclones.R") +targets::tar_make(dplyr::starts_with("cyclone")) ``` or from the command line/terminal as follows: ```Bash -Rscript -e "targets::tar_make(script = "_targets_cyclones.R)" +Rscript -e "targets::tar_make(dplyr::starts_with('cyclone'))" ``` Running specific components of a workflow involves specifying a target name or target names of the components you want to run. You should be able to run a full workflow path by just specifying the name of the last target in the workflow sequence. For example, the following will run the entire cyclones data workflow (as an alternative to what is shown above): ```R -targets::tar_make(cyclones_peak_data_csv, script = "_targets_cyclones.R") +targets::tar_make(cyclones_peak_data_csv) ``` or from the command line/terminal as follows: ```Bash -Rscript -e "targets::tar_make(cyclones_peak_data_csv, script = "_targets_cyclones.R")" +Rscript -e "targets::tar_make(cyclones_peak_data_csv)" ``` The target `cyclones_peak_data_csv` is the last target of the cyclones data workflow. Hence, to be able to produce the `cyclones_peak_data_csv` target requires running this series of linked targets. @@ -205,10 +168,10 @@ The target `cyclones_peak_data_csv` is the last target of the cyclones data work If you would like to run a set of interrelated but not fully linked targets, you will need to specify more than one target name. For this, you can use `tidyselect` approaches to name targets to be run. For example: ```R -targets::tar_make(dplyr::starts_with("cyclone"), script = "_targets_cyclones.R") +targets::tar_make(dplyr::starts_with(c("cyclone", "dam")) ``` -will run all targets in the cyclones data workflow whose names start with *"cyclone"*. +will run all targets in the cyclones and dam levels data workflow. The project also has a workflow for weekly GitHub release of the various raw datasets. @@ -216,11 +179,10 @@ The project also has a workflow for weekly GitHub release of the various raw dat cat( "```mermaid", targets::tar_mermaid( - targets_only = TRUE, color = FALSE, legend = FALSE, - script = "_targets_releases.R" + targets_only = TRUE, names = dplyr::starts_with("paglaom_weekly"), + color = FALSE, legend = FALSE ), "```", - sep = "\n" ) ``` diff --git a/README.md b/README.md index c9ddd71..f20f731 100644 --- a/README.md +++ b/README.md @@ -177,73 +177,30 @@ to install all R package dependencies. Currently, the project has workflows that curate the following datasets: 1. Tropical cyclones data for various cyclones entering the Philippine - area of responsibility since 2017 + area of responsibility since 2017; - +2. Daily heat index data from various data collection points in the + Philippines; -``` mermaid -graph LR - style Graph fill:#FFFFFF00,stroke:#000000; - subgraph Graph - direction LR - x1cf596d0c4f824b5["cyclone_reports_download_files"]:::outdated --> x721677a433d907a0["cyclones_peak_data"]:::outdated - x6f87cfcc96bb274d(["cyclone_reports_links"]):::outdated --> x1cf596d0c4f824b5["cyclone_reports_download_files"]:::outdated - x721677a433d907a0["cyclones_peak_data"]:::outdated --> xdc5659ed1b9a196a(["cyclones_peak_data_csv"]):::outdated - end -``` +3. Climatological extremes and normals data over time; and, -2. Daily heat index data from various data collection points in the - Philippines +4. Daily dam water level data. - +The following diagram illustrates these workflows ``` mermaid graph LR style Graph fill:#FFFFFF00,stroke:#000000; subgraph Graph direction LR - x567709ab5f0adc71(["heat_index_pubfiles_url"]):::outdated --> x56bd7c118ed46a38(["heat_index_links"]):::outdated x56bd7c118ed46a38(["heat_index_links"]):::outdated --> x113a83dcec46090f(["heat_index_links_urls"]):::outdated + x567709ab5f0adc71(["heat_index_pubfiles_url"]):::uptodate --> x56bd7c118ed46a38(["heat_index_links"]):::outdated + xb48a3b157c96bffd(["climate_pubfiles_url"]):::uptodate --> xa37a01adfb45bd68(["climate_directory_urls"]):::uptodate + x26b861c7a0a21b52["climate_pdf_urls"]:::uptodate --> xc044beb81380bb4a["climate_download_files"]:::uptodate xc432bd4e21a7b9fa(["heat_index_links_dates"]):::outdated --> x4f749438c4164b8e["heat_index_download_files"]:::outdated x113a83dcec46090f(["heat_index_links_urls"]):::outdated --> x4f749438c4164b8e["heat_index_download_files"]:::outdated x56bd7c118ed46a38(["heat_index_links"]):::outdated --> xc432bd4e21a7b9fa(["heat_index_links_dates"]):::outdated - end -``` - -3. Climatological extremes and normals data over time - - - -``` mermaid -graph LR - style Graph fill:#FFFFFF00,stroke:#000000; - subgraph Graph - direction LR - xb48a3b157c96bffd(["climate_pubfiles_url"]):::uptodate --> xa37a01adfb45bd68(["climate_directory_urls"]):::uptodate - xc044beb81380bb4a["climate_download_files"]:::uptodate --> x84b857e732ff3c29(["pagasa_weather_stations"]):::outdated xa37a01adfb45bd68(["climate_directory_urls"]):::uptodate --> x26b861c7a0a21b52["climate_pdf_urls"]:::uptodate - x26b861c7a0a21b52["climate_pdf_urls"]:::uptodate --> xc044beb81380bb4a["climate_download_files"]:::uptodate - xc044beb81380bb4a["climate_download_files"]:::uptodate --> xe06460aefd475ca2(["climate_data_extremes_2020"]):::outdated - xc044beb81380bb4a["climate_download_files"]:::uptodate --> xc83b489a1c433852(["climate_data_extremes_2021"]):::outdated - xc044beb81380bb4a["climate_download_files"]:::uptodate --> x9b64b30afbfc8ff9(["climate_data_extremes_2022"]):::outdated - xc044beb81380bb4a["climate_download_files"]:::uptodate --> xf620d5783ff15609(["climate_data_extremes_2023"]):::outdated - xc044beb81380bb4a["climate_download_files"]:::uptodate --> x42da7c0722c063a6(["climate_data_normals_1991_2020"]):::outdated - end -``` - -4. Daily dam water level data - - - -``` mermaid -graph LR - style Graph fill:#FFFFFF00,stroke:#000000; - subgraph Graph - direction LR - x0de96327cc07b160(["dam_level_data"]):::outdated --> x202d34e7af3ea1c1(["dam_level_data_raw_csv"]):::outdated - xd2c3c65ab78d2c70(["dam_level_data_processed"]):::uptodate --> xfa0b497de91938bb(["dam_level_data_csv"]):::uptodate - x7255575025352eb6(["dam_level_data_files"]):::uptodate --> xd2c3c65ab78d2c70(["dam_level_data_processed"]):::uptodate - xc77bb431ac7c3081(["dam_level_url"]):::uptodate --> x0de96327cc07b160(["dam_level_data"]):::outdated end ``` @@ -251,21 +208,20 @@ To run any of these workflows, run the following command on the R console: ``` r -targets::tar_make(script = "NAME_OF_TARGET_SCRIPT_R_FILE") +targets::tar_make(dplyr::starts_with("PREFIX")) ``` -replacing `"NAME_OF_TARGET_SCRIPT_R_FILE"` with the name of the target -script file for the specific workflow. For example, to run the cyclones -workflow from R console: +replacing `"PREFIX"` with the keyword for the type of data. For example, +to run the cyclones workflow from R console: ``` r -targets::tar_make(script = "_targets_cyclones.R") +targets::tar_make(dplyr::starts_with("cyclone")) ``` or from the command line/terminal as follows: ``` bash -Rscript -e "targets::tar_make(script = "_targets_cyclones.R)" +Rscript -e "targets::tar_make(dplyr::starts_with('cyclone'))" ``` Running specific components of a workflow involves specifying a target @@ -276,13 +232,13 @@ entire cyclones data workflow (as an alternative to what is shown above): ``` r -targets::tar_make(cyclones_peak_data_csv, script = "_targets_cyclones.R") +targets::tar_make(cyclones_peak_data_csv) ``` or from the command line/terminal as follows: ``` bash -Rscript -e "targets::tar_make(cyclones_peak_data_csv, script = "_targets_cyclones.R")" +Rscript -e "targets::tar_make(cyclones_peak_data_csv)" ``` The target `cyclones_peak_data_csv` is the last target of the cyclones @@ -295,11 +251,10 @@ you can use `tidyselect` approaches to name targets to be run. For example: ``` r -targets::tar_make(dplyr::starts_with("cyclone"), script = "_targets_cyclones.R") +targets::tar_make(dplyr::starts_with(c("cyclone", "dam")) ``` -will run all targets in the cyclones data workflow whose names start -with *“cyclone”*. +will run all targets in the cyclones and dam levels data workflow. The project also has a workflow for weekly GitHub release of the various raw datasets. diff --git a/_targets_dam.R b/_targets_dam.R index c7f4d92..a795262 100644 --- a/_targets_dam.R +++ b/_targets_dam.R @@ -52,7 +52,8 @@ output_targets <- tar_plan( ### Output processed dam level data as CSV ---- tar_target( name = dam_level_data_csv, - command = dam_archive_processed(dam_level_data_processed) + command = dam_archive_processed(dam_level_data_processed), + format = "file" ) ) diff --git a/_targets_releases.R b/_targets_releases.R index 8a81bb2..360b3ac 100644 --- a/_targets_releases.R +++ b/_targets_releases.R @@ -17,12 +17,7 @@ release_targets <- tar_plan( tar_target( name = paglaom_weekly_release, command = paglaom_upload_weekly_release( - climate_download_files, - cyclone_reports_download_files, - dam_level_data_files, - heat_index_download_files, - #tag = paglaom_weekly_release_tag - tag = "1.8.34" + tag = paglaom_weekly_release_tag ) ) ) From 1694ccf1236d4bd0bd0ec596c0fae43ce8f1f314 Mon Sep 17 00:00:00 2001 From: Ernest Guevarra Date: Sun, 1 Sep 2024 22:32:35 +0100 Subject: [PATCH 3/3] refactor GHA workflows; fix #52 --- .github/workflows/deploy-targets-dam.yml | 2 +- .github/workflows/test-targets-climate.yml | 2 +- .github/workflows/test-targets-cyclones.yml | 2 +- .github/workflows/test-targets-dam.yml | 2 +- .github/workflows/test-targets-workflow.yml | 48 --------------------- 5 files changed, 4 insertions(+), 52 deletions(-) delete mode 100644 .github/workflows/test-targets-workflow.yml diff --git a/.github/workflows/deploy-targets-dam.yml b/.github/workflows/deploy-targets-dam.yml index f98b46a..c5d7709 100644 --- a/.github/workflows/deploy-targets-dam.yml +++ b/.github/workflows/deploy-targets-dam.yml @@ -38,7 +38,7 @@ jobs: - name: Run workflow run: | - targets::tar_make(script = "_targets_dam.R") + targets::tar_make(dam_level_data_raw_csv) shell: Rscript {0} - name: Commit and push files diff --git a/.github/workflows/test-targets-climate.yml b/.github/workflows/test-targets-climate.yml index 445dc0e..01366ff 100644 --- a/.github/workflows/test-targets-climate.yml +++ b/.github/workflows/test-targets-climate.yml @@ -34,5 +34,5 @@ jobs: - name: Run workflow run: | - targets::tar_make(script = "_targets_climate.R") + targets::tar_make(dplyr::starts_with("climate")) shell: Rscript {0} diff --git a/.github/workflows/test-targets-cyclones.yml b/.github/workflows/test-targets-cyclones.yml index f5bf1fa..226ef92 100644 --- a/.github/workflows/test-targets-cyclones.yml +++ b/.github/workflows/test-targets-cyclones.yml @@ -34,5 +34,5 @@ jobs: - name: Run workflow run: | - targets::tar_make(script = "_targets_cyclones.R") + targets::tar_make(dplyr::starts_with("cyclone")) shell: Rscript {0} diff --git a/.github/workflows/test-targets-dam.yml b/.github/workflows/test-targets-dam.yml index a107fed..e2e1a28 100644 --- a/.github/workflows/test-targets-dam.yml +++ b/.github/workflows/test-targets-dam.yml @@ -34,5 +34,5 @@ jobs: - name: Run workflow run: | - targets::tar_make(script = "_targets_dam.R") + targets::tar_make(dplyr::starts_with("dam")) shell: Rscript {0} diff --git a/.github/workflows/test-targets-workflow.yml b/.github/workflows/test-targets-workflow.yml deleted file mode 100644 index 0796173..0000000 --- a/.github/workflows/test-targets-workflow.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: test targets workflow - -on: - # push: - # branches: [main, master] - # pull_request: - # branches: [main, master] - workflow_dispatch: - branches: - - '*' - -jobs: - test-targets-workflow: - runs-on: ubuntu-latest - container: rocker/tidyverse:4.4.1 - env: - GIT_CRYPT_KEY64: ${{ secrets.GIT_CRYPT_KEY64 }} - steps: - - uses: actions/checkout@v4 - - - name: Install system dependencies - run: | - apt-get update && apt-get install -y --no-install-recommends \ - libxt6 libglpk-dev libpoppler-cpp-dev libmagick++-dev \ - libtesseract-dev libleptonica-dev tesseract-ocr-eng - - - name: Trust git repo - run: | - git config --global --add safe.directory /__w/paglaom/paglaom - - - name: Install packages from renv.lock (with cache) - if: ${{ !env.ACT }} - uses: r-lib/actions/setup-renv@v2 - with: - cache-version: 2 - - - name: Install packages from renv.lock (local, no cache) - if: ${{ env.ACT }} - run: | - renv::restore() - shell: Rscript {0} - - - name: Run workflow - run: | - targets::tar_make( - cyclones_peak_data_csv, script = "_targets_cyclones.R" - ) - shell: Rscript {0}