Skip to content

Comment out the closing parenthesis for the precipitation_chelsa targ… #4183

Comment out the closing parenthesis for the precipitation_chelsa targ…

Comment out the closing parenthesis for the precipitation_chelsa targ… #4183

Workflow file for this run

# MIT License
# Copyright (c) 2021 Eli Lilly and Company
# Author: William Michael Landau (will.landau at gmail)
# Edited by Adam Wilson (adamw at buffalo)
# Written with help from public domain (CC0 1.0 Universal) workflow files by Jim Hester:
# * https://github.com/r-lib/actions/blob/master/examples/check-full.yaml
# * https://github.com/r-lib/actions/blob/master/examples/blogdown.yaml
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
on:
push:
branches:
- main
- master
- dev-adam-appeears
- dev-jiyeon
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
# - cron: '1 0 * * 0' # runs every Sunday at 00:01
- cron: '0 0 * * *' # runs every day at midnight
# - cron: '0 */6 * * *' # run every 6th hour
name: targets
jobs:
targets:
runs-on: ubuntu-latest
container: adamwilsonlab/emma:latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
EARTHDATA_PASSWORD: ${{ secrets.EARTHDATA_PASSWORD }}
EARTHDATA_USER: ${{ secrets.EARTHDATA_USER }}
RENV_PATHS_ROOT: ~/.local/share/renv
ACTIONS_RUNNER_DEBUG: true
steps:
- uses: actions/checkout@v2
with:
ref: dev-adam-appeears
lfs: true
- name: Whitelist directory
run: git config --global --add safe.directory /__w/emma_envdata/emma_envdata
- name: Install system deps for keyring
run: |
apt-get update
apt-get install -y libsecret-1-0 libsecret-1-dev
- name: Install R Package Dependencies
run: |-
Rscript -e "questionr::qscan(list.files(pattern='*.R',recursive=T), load = TRUE, detail = TRUE)" # this scans all scripts and installs any needed packages
- name: Parse _targets.R
run: Rscript -e "parse('_targets.R')"
- name: Cache packages
uses: actions/cache@v3
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: ${{ runner.os }}-renv-
- name: Cache targets store
uses: actions/cache@v3
with:
path: _targets/
key: targets-${{ hashFiles('_targets.R', 'R/**') }}
restore-keys: targets-
- name: Run targets pt 2
run: |
targets::tar_make()
shell: Rscript {0}
- name: Update README
run: |
webshot::install_phantomjs()
knitr::knit("README.Rmd")
shell: Rscript {0}
- name: Export final data products to releases
if: github.ref == 'refs/heads/main'
run: |
# Load final targets and export to data/releases/
targets::tar_load_everything()
# Create releases directory
dir.create("data/releases", recursive = TRUE, showWarnings = FALSE)
# Export domain as gpkg (example - adjust to your actual target names)
if (exists("domain")) {
sf::st_write(
sf::st_as_sf(domain),
"data/releases/domain.gpkg",
delete_dsn = TRUE
)
}
# Add other final outputs here as needed
# Example: write.csv(final_data, "data/releases/final_data.csv")
shell: Rscript {0}
continue-on-error: true
- name: Upload to GitHub Releases
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v1
with:
tag_name: latest
files: |
data/releases/*
body: |
Latest data products from targets pipeline
Updated: ${{ github.event.head_commit.timestamp }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare failure artifact
if: failure()
run: rm -rf .git .github
- name: Post failure artifact
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-results
path: .