Skip to content

Commit b2be0f1

Browse files
committed
ci: use DESTDIR to capture only built library installables for cache
1 parent 4bf3cef commit b2be0f1

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

.github/actions/environment-check/action.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ runs:
3636
if: steps.env-cache.outputs.cache-hit == 'true'
3737
shell: bash
3838
run: |
39-
echo "===== Deploying cached deps to /usr/local/ ====="
40-
if [ -d "$RUNNER_TEMP/dvledtx-deps" ]; then
41-
sudo cp -rp "$RUNNER_TEMP/dvledtx-deps/". /usr/local/
39+
echo "===== Deploying cached deps to system ====="
40+
DEPS_DIR="$RUNNER_TEMP/dvledtx-deps"
41+
if [ -d "$DEPS_DIR" ]; then
42+
# DESTDIR-captured tree has structure DEPS_DIR/usr/local/...; copy to /
43+
sudo cp -rp "$DEPS_DIR/." /
4244
sudo ldconfig
43-
echo " Cache deployed to /usr/local/"
45+
echo " Cache deployed. Size: $(du -sh "$DEPS_DIR" | cut -f1)"
4446
else
4547
echo " No cached deps found, will build from source."
4648
fi
@@ -126,6 +128,7 @@ runs:
126128
meson setup build
127129
ninja -C build
128130
sudo ninja install -C build
131+
DESTDIR="$RUNNER_TEMP/dvledtx-deps" ninja install -C build
129132
sudo ldconfig
130133
echo " DPDK installed: $(pkg-config --modversion libdpdk)"
131134
@@ -148,6 +151,8 @@ runs:
148151
fi
149152
cd "$MTL_SOURCE"
150153
./build.sh
154+
# Capture MTL installables via DESTDIR (build.sh uses meson internally)
155+
DESTDIR="$RUNNER_TEMP/dvledtx-deps" ninja -C "$MTL_SOURCE/build" install
151156
sudo ldconfig
152157
echo " MTL installed: $(pkg-config --modversion mtl)"
153158
@@ -166,6 +171,7 @@ runs:
166171
git checkout openh264v2.4.0
167172
make -j "$(nproc)"
168173
sudo make install
174+
make install DESTDIR="$RUNNER_TEMP/dvledtx-deps"
169175
sudo ldconfig
170176
echo " openh264 installed."
171177
@@ -194,6 +200,7 @@ runs:
194200
--enable-libopenh264 --enable-encoder=libopenh264 --enable-mtl
195201
make -j "$(nproc)"
196202
sudo make install
203+
make install DESTDIR="$RUNNER_TEMP/dvledtx-deps"
197204
sudo ldconfig
198205
echo " FFmpeg installed: $(ffmpeg -version 2>&1 | head -1)"
199206
@@ -233,12 +240,10 @@ runs:
233240
exit 1
234241
fi
235242
236-
- name: Stage deps for cache
243+
- name: Report cache size
237244
if: steps.env-cache.outputs.cache-hit != 'true'
238245
shell: bash
239246
run: |
240-
echo "===== Staging /usr/local/ for cache ====="
241-
mkdir -p "$RUNNER_TEMP/dvledtx-deps"
242-
sudo cp -rp /usr/local/lib /usr/local/include /usr/local/bin /usr/local/share \
243-
"$RUNNER_TEMP/dvledtx-deps/"
244-
echo " Staged to $RUNNER_TEMP/dvledtx-deps — will be saved to cache."
247+
echo "===== Cache Content Summary ====="
248+
du -sh "$RUNNER_TEMP/dvledtx-deps" || true
249+
echo " Cache will be saved automatically by actions/cache."

0 commit comments

Comments
 (0)