Skip to content

Start a shell for failed runs #45

Start a shell for failed runs

Start a shell for failed runs #45

name: Automate CTA schedule and realtime downloads
on:
push:
branches:
- 'automate-schedule-downloads'
- 'date-range-downloads'
- 'compare-realtime-schedule'
schedule:
# Run every day at 12:30pm CST which is 5:30pm UTC
- cron: 30 17 * * *
env:
PYTHON_VERSION: 3.10.6
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# Changing ubuntu version to 20.04 might resolve some timeout issues
# See https://github.com/actions/runner-images/issues/6680
jobs:
download-cta-schedule-data:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Download and save CTA schedule data
run: |
pip install -r requirements.txt
python -c 'from scrape_data.cta_data_downloads import save_cta_zip; \
save_cta_zip()' \
$AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY
save-schedule-daily-summary:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: 'Save schedule summaries'
# Test with no date and with date range
run: |
pip install -r requirements.txt
python -c 'from scrape_data.cta_data_downloads import save_sched_daily_summary; \
save_sched_daily_summary()' $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY
save-realtime-daily-summary:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: 'Save realtime summaries'
run: |
pip install -r requirements.txt
python -c 'from scrape_data.cta_data_downloads import save_realtime_daily_summary; \
save_realtime_daily_summary()' $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY
save-frontend-map-json:
runs-on: macos-latest
needs: [save-realtime-daily-summary, save-schedule-daily-summary]
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: 'Save data.json for frontend'
run: |
pip install -r requirements.txt
python -c 'from scrape_data.cta_data_downloads import compare_realtime_sched; \
compare_realtime_sched()' $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY
- name: tmate session on error
if: failure()
uses: mxschmitt/action-tmate@v3