ci(build-all): install only what the matrix generator needs

The scan job is the one job in this workflow that runs outside the build
container, so it installs its own Python dependencies. It was installing all
31 entries of requirements.txt to run a script that reaches four of them, and
every one of the other 27 was a chance to fail: the job has died on packaging
and on lxml, neither of which it imports.

Drop the pip cache with it. Restoring it costs about as long as fetching four
small wheels, and its key used hashFiles('**./Tools/setup/requirements.txt'),
a glob that matches nothing. The hash was empty, so the key collapsed to
"Linux-pip-", matched its own restore-key, and never saved again after the
first write in April.

Verified in a clean python:3.12-slim container: generate_board_targets_json.py
exits 0 for both --group and --group --seeders with exactly these four
installed. pyyaml and kconfiglib alone are not enough, since
loadconfig.ensure_env() shells out to the zenoh generator, which needs empy
and pyros-genmsg.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
Ramon Roche committed 2026-08-20 12:11:15 -07:00
1 parent 1fa6012d5d
commit 97c35057ce
1 file changed
+6 -9
+6 -9
View File
@@ -78,16 +78,13 @@ jobs:
- uses: runs-on/action@v2
- uses: actions/checkout@v6
- name: Cache Python pip
uses: actions/cache@v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**./Tools/setup/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# This job runs outside the build container, so it installs its own
# dependencies. It needs what the matrix generator actually reaches:
# yaml, kconfiglib via Tools/kconfig/loadconfig.py, and empy plus
# pyros-genmsg for the zenoh generator that loadconfig shells out to
# in ensure_env(). Everything else it runs is stdlib.
- name: Install Python Dependencies
run: pip3 install -U packaging -r ./Tools/setup/requirements.txt
run: pip3 install pyyaml kconfiglib 'empy>=3.3,<4' pyros-genmsg
# The generator runs as a standalone assignment so a non-zero exit
# fails the step; embedded in `echo "x=$(...)"` it would be masked