Skip to content

Commit

Permalink
allow manual run to specify data URL
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Sep 13, 2024
1 parent beda656 commit aa6773f
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/download_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ name: download and cache data
on:
workflow_call:
inputs:
url:
description: URL to gzip file
type: string
required: false
default: https://stsci.box.com/shared/static/0dt9z6b927iqgtify2a4cvls9hvapi6k.gz
minimal:
description: minimal dataset
description: dataset is minimal (as opposed to full)
type: boolean
required: false
default: true
Expand All @@ -41,25 +46,33 @@ on:
value: ${{ jobs.download.outputs.cache_key }}
workflow_dispatch:
inputs:
url:
description: URL to gzip file
type: string
required: false
default: https://stsci.box.com/shared/static/0dt9z6b927iqgtify2a4cvls9hvapi6k.gz
minimal:
description: minimal dataset
description: dataset is minimal (as opposed to full)
type: boolean
required: false
default: true
schedule:
- cron: "0 0 * * 0"
release:
push:
branches:
- develop

env:
DATA_URL: https://stsci.box.com/shared/static/qxpiaxsjwo15ml6m4pkhtk36c9jgj70k.gz
FULL_DATA_URL: https://stsci.box.com/shared/static/qxpiaxsjwo15ml6m4pkhtk36c9jgj70k.gz
MINIMAL_DATA_URL: https://stsci.box.com/shared/static/0dt9z6b927iqgtify2a4cvls9hvapi6k.gz

jobs:
download:
name: download and cache WebbPSF data
runs-on: ubuntu-latest
steps:
- run: wget ${{ (github.event_name == 'schedule' || github.event_name == 'release') && env.MINIMAL_DATA_URL || inputs.minimal && env.MINIMAL_DATA_URL || env.DATA_URL }} -O ${{ runner.temp }}/webbpsf-data.tar.gz
- run: wget ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') && inputs.url || env.MINIMAL_DATA_URL }} -O ${{ runner.temp }}/webbpsf-data.tar.gz
- run: mkdir ${{ runner.temp }}/data/
- run: tar -xzvf ${{ runner.temp }}/webbpsf-data.tar.gz -C ${{ runner.temp }}/data/
- id: cache_path
Expand Down

0 comments on commit aa6773f

Please sign in to comment.