|
24 | 24 |
|
25 | 25 | # ===============================================
|
26 | 26 |
|
27 |
| - - uses: Swatinem/rust-cache@v2 |
28 |
| - |
29 |
| - - uses: ./.github/actions/elapsed-time |
30 |
| - with: |
31 |
| - statement: "rust-cache" |
32 |
| - |
33 |
| - # =============================================== |
34 |
| - |
35 | 27 | - uses: cargo-bins/cargo-binstall@main
|
36 | 28 |
|
37 | 29 | # ===============================================
|
|
42 | 34 | cargo binstall --no-confirm lychee prefligit ripgrep
|
43 | 35 | cargo binstall --no-confirm --locked taplo-cli
|
44 | 36 |
|
45 |
| - - name: Debug installed binaries |
46 |
| - shell: bash |
47 |
| - run: | |
48 |
| - echo "PATH is: $PATH" |
49 |
| - echo "CARGO_HOME is: $CARGO_HOME" |
50 |
| -
|
51 |
| - echo |
52 |
| - echo "==== Searching each PATH directory for 'prefligit' or 'rg' ====" |
53 |
| - IFS=':' read -ra PATH_ARRAY <<< "$PATH" |
54 |
| - for dir in "${PATH_ARRAY[@]}"; do |
55 |
| - echo "-> Checking $dir" |
56 |
| - # Only list if directory actually exists (some paths may not exist) |
57 |
| - if [ -d "$dir" ]; then |
58 |
| - ls -1 "$dir" | grep -E '^(prefligit|rg)$' || true |
59 |
| - else |
60 |
| - echo " (Not a directory)" |
61 |
| - fi |
62 |
| - done |
63 |
| -
|
64 |
| - echo |
65 |
| - echo "==== Checking 'which' output for 'prefligit' or 'rg' ====" |
66 |
| - which prefligit || echo "'prefligit' not found by 'which'" |
67 |
| - which rg || echo "'rg' not found by 'which'" |
68 |
| -
|
69 |
| - echo |
70 |
| - echo "==== Brute-force searching /home/runner for 'prefligit' and 'rg' ====" |
71 |
| - # Use 'find' instead of 'rg', since 'rg' is missing |
72 |
| - echo "Searching for prefligit..." |
73 |
| - find /home/runner -name prefligit 2>/dev/null || echo "No prefligit found." |
74 |
| -
|
75 |
| - echo |
76 |
| - echo "Searching for rg..." |
77 |
| - find /home/runner -name rg 2>/dev/null || echo "No rg found." |
78 |
| -
|
79 | 37 | - uses: ./.github/actions/elapsed-time
|
80 | 38 | with:
|
81 | 39 | statement: "install lychee prefligit ripgrep taplo-cli"
|
|
93 | 51 |
|
94 | 52 | # ===============================================
|
95 | 53 |
|
| 54 | + ### rust-cache ### |
| 55 | + # a) save all contents even after its action location |
| 56 | + # |
| 57 | + # b) doesn’t cache binaries, but the related metadata will, |
| 58 | + # so caused issues like “cargo binstall” detect binaries |
| 59 | + # are installed, but actually they don’t exist! These |
| 60 | + # binary installations should be put BEFORE this |
| 61 | + # rust-cache action |
| 62 | + # |
| 63 | + # c) doesn’t remove user's bin files, the "Any files in |
| 64 | + # ~/.cargo/bin that were present before the action |
| 65 | + # ran (for example rustc)." says the cache itself |
| 66 | + |
| 67 | + - uses: Swatinem/rust-cache@v2 |
| 68 | + |
| 69 | + - uses: ./.github/actions/elapsed-time |
| 70 | + with: |
| 71 | + statement: "rust-cache" |
| 72 | + |
| 73 | + # =============================================== |
| 74 | + |
96 | 75 | - name: restore lychee cache
|
97 | 76 | uses: actions/cache@v4
|
98 | 77 | with:
|
|
0 commit comments