Skip to content

Commit

Permalink
simplify gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
smwoodman committed Sep 5, 2023
1 parent 20e108b commit 1cd7ea5
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions .github/workflows/data-to-dwc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,38 @@ name: Convert CSV files to Darwin Core compliant event and occurrence files

on:
push:
branches: [main, master]
branches: [main]
pull_request:
branches: [main, master]
branches: [main]

jobs:
generate-data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'renv'
- uses: r-lib/actions/setup-renv@v2

- uses: actions/cache@v3 # Cache packages so won't be compiled everytime job is run
with:
path: ~/.local/share/renv
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-
- name: Cache packages
uses: actions/cache@v3
with:
path: ~/.local/share/renv
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-
- name: Restore packages
shell: Rscript {0}
run: |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
renv::restore()
# - uses: actions/cache@v3 # Cache packages so won't be compiled everytime job is run
# with:
# path: ~/.local/share/renv
# key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
# restore-keys: |
# ${{ runner.os }}-renv-
#
# - name: Cache packages
# uses: actions/cache@v3
# with:
# path: ~/.local/share/renv
# key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
# restore-keys: |
# ${{ runner.os }}-renv-
#
# - name: Restore packages
# shell: Rscript {0}
# run: |
# if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
# renv::restore()

- name: Generate data # Run the script
run: source("R/data_to_dwc.R")
Expand Down

0 comments on commit 1cd7ea5

Please sign in to comment.