CI: cache apt and Homebrew downloads

Package installs sometimes stall on GitHub's runners. A local action
(.github/actions/apt, and .github/actions/brew where macOS builds) caches
the downloaded packages, and apt's package lists with them, keyed on the
runner image and the package list. A cache hit installs offline; a miss
installs as before, with retries and timeouts, and saves the cache.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRUAp3wTZAV7UCEiC4S
This commit is contained in:
Claude committed 2026-11-01 01:11:54 +00:00
1 parent 2ddc0111f3
commit e9bc87fc5e
3 files changed
+95 -11

No files matched your search

+9 -5
View File
@@ -4,9 +4,9 @@ name: firmware
on:
push:
paths: ["firmware/**", "hardware/netlist/**", ".github/workflows/firmware.yml"]
paths: ["firmware/**", "hardware/netlist/**", ".github/workflows/firmware.yml", ".github/actions/apt/**"]
pull_request:
paths: ["firmware/**", "hardware/netlist/**", ".github/workflows/firmware.yml"]
paths: ["firmware/**", "hardware/netlist/**", ".github/workflows/firmware.yml", ".github/actions/apt/**"]
jobs:
build-and-test:
@@ -14,10 +14,14 @@ jobs:
steps:
- uses: actions/checkout@v4
# (apt's downloads cached: .github/actions/apt)
- name: Tools
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib ninja-build cmake
uses: ./.github/actions/apt
with:
packages: >-
gcc-arm-none-eabi libnewlib-arm-none-eabi
libstdc++-arm-none-eabi-newlib ninja-build cmake
recommends: 'true'
- name: Pin header matches the netlist
run: |
+7 -6
View File
@@ -9,9 +9,9 @@ name: hardware
on:
push:
paths: ["hardware/**", ".github/workflows/hardware.yml"]
paths: ["hardware/**", ".github/workflows/hardware.yml", ".github/actions/apt/**"]
pull_request:
paths: ["hardware/**", ".github/workflows/hardware.yml"]
paths: ["hardware/**", ".github/workflows/hardware.yml", ".github/actions/apt/**"]
jobs:
check:
@@ -19,11 +19,12 @@ jobs:
steps:
- uses: actions/checkout@v4
# (apt's downloads cached: .github/actions/apt)
- name: KiCad 9
run: |
sudo add-apt-repository -y ppa:kicad/kicad-9.0-releases
sudo apt-get update -qq
sudo apt-get install -y -qq --no-install-recommends kicad
uses: ./.github/actions/apt
with:
ppa: ppa:kicad/kicad-9.0-releases
packages: kicad
- name: Netlists and schematics match the netlist script
run: |