Skip to content

Merge pull request #170 from HWO-Yield-Visualizations/dependabot/gith… #258

Merge pull request #170 from HWO-Yield-Visualizations/dependabot/gith…

Merge pull request #170 from HWO-Yield-Visualizations/dependabot/gith… #258

Workflow file for this run

name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows us to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test:
name: Test Python ${{ matrix.python-version }} on ${{ matrix.platform }}
runs-on: ${{ matrix.platform }}
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
platform: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v6
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
activate-environment: true
# Cache EXOSIMS data (downloads + computed cache like completeness, star fluxes)
# Only invalidates when dependencies change (uv.lock hash)
- name: Cache EXOSIMS data
uses: actions/cache@v6
with:
path: ~/.EXOSIMS
key: exosims-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
exosims-${{ runner.os }}-
# Pre-download Forecaster parameters if not cached
- name: Pre-download Forecaster parameters
run: |
mkdir -p ~/.EXOSIMS/downloads
if [ ! -f ~/.EXOSIMS/downloads/fitting_parameters.h5 ]; then
curl -fsSL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://raw.githubusercontent.com/dsavransky/forecaster/master/fitting_parameters.h5" \
-o ~/.EXOSIMS/downloads/fitting_parameters.h5 || echo "Download failed, EXOSIMS will retry"
fi
- name: Install nox
run: uv tool install nox
- name: Test with nox
run: uvx nox -s tests --python ${{ matrix.python-version }}