Skip to content

CI: cache apt packages#558

Merged
hagenw merged 4 commits into
mainfrom
ci-cache-apt-packages
Apr 13, 2026
Merged

CI: cache apt packages#558
hagenw merged 4 commits into
mainfrom
ci-cache-apt-packages

Conversation

@hagenw
Copy link
Copy Markdown
Member

@hagenw hagenw commented Apr 13, 2026

Use awalsh128/cache-apt-pkgs-action to cache apt packages, which caused very slow CI pipelines from time to time before.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Apr 13, 2026

Reviewer's Guide

Replaces inline apt-get install steps in CI workflows with the cache-apt-pkgs GitHub Action to cache and reuse apt packages across runs, aiming to reduce pipeline flakiness and runtime.

Flow diagram for cache-apt-pkgs CI step behavior

flowchart TD
    start[Start_CI_job]
    step[Run_cache_apt_pkgs_step]
    computeKey[Compute_cache_key_from_packages_and_version]
    checkCache{Cache_hit_for_key?}
    useCache[Use_cached_deb_packages_and_installed_binaries]
    installApt[Install_packages_via_apt_get]
    saveCache[Save_downloaded_packages_to_cache]
    nextStep[Run_subsequent_steps_such_as_build_docs_and_tests]
    endJob[End_CI_job]

    start --> step --> computeKey --> checkCache
    checkCache -->|Yes| useCache --> nextStep
    checkCache -->|No| installApt --> saveCache --> nextStep
    nextStep --> endJob
Loading

File-Level Changes

Change Details Files
Switch Ubuntu libsndfile installation in tests workflow to use cache-apt-pkgs action with a fixed cache version.
  • Replace shell-based apt-get update/install step with awalsh128/cache-apt-pkgs-action usage.
  • Configure the action to install the libsndfile1 package only on ubuntu-latest matrix jobs.
  • Pin the cache version to 1.0 to control cache invalidation.
.github/workflows/test.yml
Switch Ubuntu ffmpeg and mediainfo installation in tests workflow to use cache-apt-pkgs action with a fixed cache version.
  • Replace combined apt-get update/install step with awalsh128/cache-apt-pkgs-action usage.
  • Configure the action to install both ffmpeg and mediainfo packages for ubuntu-latest jobs.
  • Pin the cache version to 1.0 for these media packages to manage cache refresh.
.github/workflows/test.yml
Use cache-apt-pkgs for Ubuntu libsndfile and graphviz installation in docs workflow.
  • Replace separate apt-get update/install steps for libsndfile1 with cache-apt-pkgs action.
  • Replace direct apt-get install for graphviz with cache-apt-pkgs action.
  • Set a shared cache version 1.0 for both libsndfile1 and graphviz installations.
.github/workflows/doc.yml
Use cache-apt-pkgs for all documentation-related apt packages in publish workflow.
  • Replace multi-line apt-get install of libsndfile1, sox, and graphviz with a single cache-apt-pkgs action invocation.
  • Configure the action to install all three packages together to benefit from a unified cache.
  • Pin cache version to 1.0 for these publish-time documentation dependencies.
.github/workflows/publish.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

sourcery-ai[bot]

This comment was marked as resolved.

@hagenw hagenw merged commit 63012a4 into main Apr 13, 2026
11 checks passed
@hagenw hagenw deleted the ci-cache-apt-packages branch April 13, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant