From 2763e923fc7f6061fb84c3f6e53a1ed6702f0064 Mon Sep 17 00:00:00 2001 From: ggman12 Date: Sun, 1 Feb 2026 21:01:31 -0500 Subject: [PATCH] use cache from github workflows --- .github/workflows/process-historical-faa.yaml | 27 ++++++++++++++----- src/get_historical_faa.py | 11 -------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/process-historical-faa.yaml b/.github/workflows/process-historical-faa.yaml index 804bbf8..358e440 100644 --- a/.github/workflows/process-historical-faa.yaml +++ b/.github/workflows/process-historical-faa.yaml @@ -44,8 +44,25 @@ jobs: print(f"::set-output name=matrix::{json.dumps(ranges)}") EOF + clone-faa-repo: + runs-on: ubuntu-latest + steps: + - name: Cache FAA repository + id: cache-faa-repo + uses: actions/cache@v4 + with: + path: data/scrape-faa-releasable-aircraft + key: faa-repo-v1 + + - name: Clone FAA repository + if: steps.cache-faa-repo.outputs.cache-hit != 'true' + run: | + mkdir -p data + git clone https://github.com/simonw/scrape-faa-releasable-aircraft data/scrape-faa-releasable-aircraft + echo "Repository cloned successfully" + process-chunk: - needs: generate-matrix + needs: [generate-matrix, clone-faa-repo] runs-on: ubuntu-latest strategy: max-parallel: 5 # Process 5 chunks at a time @@ -60,14 +77,12 @@ jobs: with: python-version: '3.12' - - name: Cache FAA repository - id: cache-faa-repo - uses: actions/cache@v4 + - name: Restore FAA repository cache + uses: actions/cache/restore@v4 with: path: data/scrape-faa-releasable-aircraft key: faa-repo-v1 - restore-keys: | - faa-repo-v1 + fail-on-cache-miss: true - name: Install dependencies run: | diff --git a/src/get_historical_faa.py b/src/get_historical_faa.py index 1fc3b3f..fd5b872 100644 --- a/src/get_historical_faa.py +++ b/src/get_historical_faa.py @@ -24,17 +24,6 @@ args = parser.parse_args() # Clone repository if it doesn't exist REPO = Path("data/scrape-faa-releasable-aircraft") -if not REPO.exists(): - print(f"Cloning repository to {REPO}...") - subprocess.run([ - "git", "clone", - "https://github.com/simonw/scrape-faa-releasable-aircraft", - str(REPO) - ], check=True) - print("Repository cloned successfully.") -else: - print(f"Repository already exists at {REPO}") - OUT_ROOT = Path("data/faa_releasable_historical") OUT_ROOT.mkdir(parents=True, exist_ok=True)