Skip to content

Commit

Permalink
Fix CI image generate workflow to use uv
Browse files Browse the repository at this point in the history
  • Loading branch information
garyo committed Sep 10, 2024
1 parent 2e165ac commit 04e0d41
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/make-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,33 @@ jobs:
steps:
- uses: actions/checkout@v2

# Use "uv" for python and dependency management
- uses: astral-sh/setup-uv@v2
with:
enable-cache: true
- name: Install dependencies
run: |
python --version
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
run: uv sync
- name: Generate graphs
run: |
python prune-cache.py --inplace --days 90 # Re-fetch most recent 90 days, in case of reanalysis
python sea-surface-temps.py --mode graph --dataset sst --out sst-all.png
python sea-surface-temps.py --mode graph --dataset anom --out sst-all-anom.png
python sea-surface-temps.py --mode graph --dataset sst --out sst-all.svg
python sea-surface-temps.py --mode graph --dataset anom --out sst-all-anom.svg
uv run prune-cache.py --inplace --days 90 # Re-fetch most recent 90 days, in case of reanalysis
uv run sea-surface-temps.py --mode graph --dataset sst --out sst-all.png
uv run sea-surface-temps.py --mode graph --dataset anom --out sst-all-anom.png
uv run sea-surface-temps.py --mode graph --dataset sst --out sst-all.svg
uv run sea-surface-temps.py --mode graph --dataset anom --out sst-all-anom.svg
# Maps: OK if these fail; we're looking for yesterday, might not be there yet.
- name: Generate maps
run: |
python sea-surface-temps.py --mode map --dataset sst --days-ago 2 --out sst-map.png || true
python sea-surface-temps.py --mode map --dataset anom --days-ago 2 --out sst-anom-map.png || true
uv run sea-surface-temps.py --mode map --dataset sst --days-ago 2 --out sst-map.png || true
uv run sea-surface-temps.py --mode map --dataset anom --days-ago 2 --out sst-anom-map.png || true
# This generates textures (.png) and associated colormap json files (-metadata.json)
- name: Generate map textures
run: |
rm -rf ./maps
mkdir -p ./maps
python sea-surface-temps.py --mode texture --dataset sst --days-ago 2 --out maps/sst-temp-equirect.png || true
python sea-surface-temps.py --mode texture --dataset anom --days-ago 2 --out maps/sst-temp-anomaly-equirect.png || true
uv run sea-surface-temps.py --mode texture --dataset sst --days-ago 2 --out maps/sst-temp-equirect.png || true
uv run sea-surface-temps.py --mode texture --dataset anom --days-ago 2 --out maps/sst-temp-anomaly-equirect.png || true
- name: Get current date
id: date
Expand Down

0 comments on commit 04e0d41

Please sign in to comment.