TradingAgents/.github/workflows/prefetch.yml

52 lines
1.4 KiB
YAML

name: Nightly OHLCV Prefetch
on:
schedule:
# 1:00 AM UTC — runs before iterate (6:00), research (7:00), hypothesis (8:00), discovery (12:30)
- cron: "0 1 * * *"
workflow_dispatch:
inputs:
period:
description: "History window for initial download (e.g. 1y, 6mo)"
required: false
default: "1y"
jobs:
prefetch:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up git identity
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run OHLCV prefetch
env:
PERIOD: ${{ github.event.inputs.period || '1y' }}
run: |
python scripts/prefetch_ohlcv.py --period "$PERIOD"
- name: Commit cache updates
run: |
git add data/ohlcv_cache/
if git diff --cached --quiet; then
echo "No cache changes to commit"
else
git commit -m "chore(cache): nightly OHLCV prefetch $(date -u +%Y-%m-%d)"
git push origin main
fi