File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,8 +134,11 @@ runs:
134134 run : echo "::add-matcher::.github/matchers/rust.json"
135135 shell : bash
136136
137+ # Two steps so that the actions/cache post-step (which saves the cache) runs
138+ # directly from this composite, not a nested one — nested composites break
139+ # post-step input resolution (actions/runner#3514, #2030).
137140 - name : Cache Cargo registry, index, and git DB
138- if : ${{ inputs.cargo-cache == 'true' || env.NEEDS_RUST == 'true' }}
141+ if : ${{ ( inputs.cargo-cache == 'true' || env.NEEDS_RUST == 'true') && github.ref == 'refs/heads/master ' }}
139142 uses : actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
140143 with :
141144 path : |
@@ -146,6 +149,18 @@ runs:
146149 restore-keys : |
147150 ${{ runner.os }}-cargo-
148151
152+ - name : Restore Cargo registry, index, and git DB
153+ if : ${{ (inputs.cargo-cache == 'true' || env.NEEDS_RUST == 'true') && github.ref != 'refs/heads/master' }}
154+ uses : actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
155+ with :
156+ path : |
157+ ~/.cargo/registry/index/
158+ ~/.cargo/registry/cache/
159+ ~/.cargo/git/db/
160+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
161+ restore-keys : |
162+ ${{ runner.os }}-cargo-
163+
149164 - name : Install mold
150165 if : ${{ runner.os == 'Linux' && env.DISABLE_MOLD != 'true' && inputs.mold == 'true' }}
151166 shell : bash
You can’t perform that action at this time.
0 commit comments