Skip to content

[Repo Assist] ci: add Poetry package cache to CI and nightly workflows #1436

@github-actions

Description

@github-actions

🤖 This is an automated PR from Repo Assist, an AI assistant.

Summary

Adds actions/cache@v4 to cache Poetry's downloaded package cache directory in both ci.yml and nightly-tests.yml.

Motivation

Every CI run currently downloads all wheels from scratch. The main CI matrix runs 5 Python versions × 6 test groups = 30 parallel jobs, each downloading ~500 MB of packages (numpy, scipy, statsmodels, econml, etc.). With this change, the download phase is served from cache after the first run, reducing per-job install time from ~3–5 minutes to a few seconds on cache hits.

Approach

- name: Get Poetry cache directory
  id: poetry-cache-dir
  run: echo "dir=$(poetry config cache-dir)" >> $GITHUB_OUTPUT

- name: Cache Poetry packages
  uses: actions/cache@v4
  with:
    path: $\{\{ steps.poetry-cache-dir.outputs.dir }}
    key: poetry-$\{\{ runner.os }}-py$\{\{ matrix.python-version }}-$\{\{ hashFiles('poetry.lock') }}
    restore-keys: |
      poetry-$\{\{ runner.os }}-py$\{\{ matrix.python-version }}-
  • Cache key includes OS, Python version, and poetry.lock hash for precise invalidation.
  • Restore key prefix allows partial hits when poetry.lock changes — reuses compatible cached packages and only downloads new/changed ones.
  • No semantic change to the install commands (poetry install -E ... is unchanged); caching is purely additive.
  • ci-install.yml is intentionally omitted — it installs from the PR's git HEAD directly via pip, which bypasses Poetry's cache anyway.

Trade-offs

  • Cache storage costs a small amount of GitHub Actions cache space (~500 MB per Python version), but this is well within the 10 GB default limit.
  • First run after a poetry.lock change will be a full cache miss (normal, expected behaviour).

Test Status

  • ✅ YAML is valid (verified locally)
  • ℹ️ No code changes; workflow changes only

Warning

🛡️ Protected Files — Push Permission Denied

This was originally intended as a pull request, but the patch modifies protected files. A human must create the pull request manually.

🔒 Protected files

The push was rejected because GitHub Actions does not have workflows permission to push these changes, and is never allowed to make such changes, or other authorization being used does not have this permission.

📋 Create the pull request manually
# Download the patch from the workflow run
gh run download 23944155680 -n agent -D /tmp/agent-23944155680

# Create a new branch
git checkout -b repo-assist/eng-ci-dep-caching-2026-04-ebe9b5b57280c495 main

# Apply the patch (--3way handles cross-repo patches)
git am --3way /tmp/agent-23944155680/aw-repo-assist-eng-ci-dep-caching-2026-04.patch

# Push the branch and create the pull request
git push origin repo-assist/eng-ci-dep-caching-2026-04-ebe9b5b57280c495
gh pr create --title '[Repo Assist] ci: add Poetry package cache to CI and nightly workflows' --base main --head repo-assist/eng-ci-dep-caching-2026-04-ebe9b5b57280c495 --repo py-why/dowhy

Note

🔒 Integrity filter blocked 6 items

The following items were blocked because they don't meet the GitHub integrity level.

  • #1418 list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #1399 list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #1396 list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #1392 list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #1391 list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #1371 list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@b897c2f3e43bde9ff7923c8fa9211055b26e27cc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions