File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,6 +108,15 @@ jobs:
108108 failed_projects : ${{ steps.set-failed.outputs.failed_projects }}
109109 steps :
110110 - uses : actions/checkout@v5
111+ - name : Cache Cargo registry and git
112+ uses : actions/cache@v4
113+ with :
114+ path : |
115+ ~/.cargo/registry
116+ ~/.cargo/git
117+ key : cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
118+ restore-keys : |
119+ cargo-${{ runner.os }}-
111120 - uses : pnpm/action-setup@v4
112121 - uses : heyAyushh/setup-anchor@v4.999
113122 with :
@@ -166,7 +175,6 @@ jobs:
166175 if ! anchor build; then
167176 echo "::error::anchor build failed for $project"
168177 echo "$project: anchor build failed" >> $GITHUB_WORKSPACE/failed_projects.txt
169- rm -rf target
170178 cd - > /dev/null
171179 return 1
172180 fi
@@ -175,13 +183,13 @@ jobs:
175183 if ! anchor test; then
176184 echo "::error::anchor test failed for $project"
177185 echo "$project: anchor test failed" >> $GITHUB_WORKSPACE/failed_projects.txt
178- rm -rf target node_modules
186+ rm -rf node_modules
179187 cd - > /dev/null
180188 return 1
181189 fi
182190
183191 echo "Build and tests succeeded for $project."
184- rm -rf target node_modules
192+ rm -rf node_modules
185193 cd - > /dev/null
186194 return 0
187195 }
Original file line number Diff line number Diff line change @@ -107,6 +107,15 @@ jobs:
107107 failed_projects : ${{ steps.set-failed.outputs.failed_projects }}
108108 steps :
109109 - uses : actions/checkout@v5
110+ - name : Cache Cargo registry and git
111+ uses : actions/cache@v4
112+ with :
113+ path : |
114+ ~/.cargo/registry
115+ ~/.cargo/git
116+ key : cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
117+ restore-keys : |
118+ cargo-${{ runner.os }}-
110119 - uses : pnpm/action-setup@v4
111120 - name : Use Node.js
112121 uses : actions/setup-node@v5
Original file line number Diff line number Diff line change @@ -107,6 +107,15 @@ jobs:
107107 failed_projects : ${{ steps.set-failed.outputs.failed_projects }}
108108 steps :
109109 - uses : actions/checkout@v5
110+ - name : Cache Cargo registry and git
111+ uses : actions/cache@v4
112+ with :
113+ path : |
114+ ~/.cargo/registry
115+ ~/.cargo/git
116+ key : cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
117+ restore-keys : |
118+ cargo-${{ runner.os }}-
110119 - uses : pnpm/action-setup@v4
111120 - name : Use Node.js
112121 uses : actions/setup-node@v5
Original file line number Diff line number Diff line change @@ -109,6 +109,15 @@ jobs:
109109 failed_projects : ${{ steps.set-failed.outputs.failed_projects }}
110110 steps :
111111 - uses : actions/checkout@v5
112+ - name : Cache Cargo registry and git
113+ uses : actions/cache@v4
114+ with :
115+ path : |
116+ ~/.cargo/registry
117+ ~/.cargo/git
118+ key : cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
119+ restore-keys : |
120+ cargo-${{ runner.os }}-
112121 - name : Setup build environment
113122 id : setup
114123 run : |
You can’t perform that action at this time.
0 commit comments