@@ -35,27 +35,39 @@ jobs:
35
35
- name : Install dependencies
36
36
run : poetry install --no-interaction --no-ansi
37
37
38
- - name : Cache apt packages
39
- id : cache-apt
38
+ - name : Cache Graphviz installation
39
+ id : cache-graphviz
40
40
uses : actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
41
41
with :
42
- path : /var/cache/apt/archives
43
- key : apt-${{ runner.os }}-graphviz-v1
44
- restore-keys : |
45
- apt-${{ runner.os }}-graphviz-
42
+ path : ~/graphviz-cache
43
+ key : graphviz-installed-${{ runner.os }}-v3
46
44
47
45
- name : Install Graphviz and Debug
48
46
run : |
49
47
# ---- DEBUG - REMOVE AFTER FIXING ----
50
48
echo "=== CACHE STATUS ==="
51
- echo "APT Cache hit: ${{ steps.cache-apt .outputs.cache-hit }}"
49
+ echo "Graphviz Cache hit: ${{ steps.cache-graphviz .outputs.cache-hit }}"
52
50
53
51
echo "\n=== BEFORE INSTALL ==="
54
52
which dot && echo "dot already exists" || echo "dot not found"
55
53
56
- echo "\n=== INSTALLING GRAPHVIZ ==="
57
- sudo apt-get update
58
- sudo apt-get install -y graphviz
54
+ if [ "${{ steps.cache-graphviz.outputs.cache-hit }}" = "true" ]; then
55
+ echo "\n=== RESTORING CACHED GRAPHVIZ ==="
56
+ sudo cp -r ~/graphviz-cache/bin/* /usr/bin/ 2>/dev/null || echo "No binaries to restore"
57
+ sudo cp -r ~/graphviz-cache/lib/* /usr/lib/ 2>/dev/null || echo "No libraries to restore"
58
+ sudo cp -r ~/graphviz-cache/share/* /usr/share/ 2>/dev/null || echo "No shared files to restore"
59
+ sudo ldconfig
60
+ else
61
+ echo "\n=== INSTALLING GRAPHVIZ ==="
62
+ sudo apt-get update
63
+ sudo apt-get install -y graphviz
64
+
65
+ echo "\n=== CACHING GRAPHVIZ ==="
66
+ mkdir -p ~/graphviz-cache/{bin,lib,share}
67
+ cp /usr/bin/dot /usr/bin/neato /usr/bin/twopi /usr/bin/circo /usr/bin/fdp /usr/bin/sfdp /usr/bin/patchwork /usr/bin/osage ~/graphviz-cache/bin/ 2>/dev/null || echo "Some binaries not found"
68
+ cp -r /usr/lib/x86_64-linux-gnu/*graphviz* ~/graphviz-cache/lib/ 2>/dev/null || echo "No graphviz libs found"
69
+ cp -r /usr/share/graphviz ~/graphviz-cache/share/ 2>/dev/null || echo "No graphviz share found"
70
+ fi
59
71
60
72
echo "\n=== AFTER INSTALL ==="
61
73
which dot && dot -V || echo "dot command not found"
0 commit comments