File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -33,20 +33,24 @@ const allModes = {
3333 name : "clippy" ,
3434 cargoCommand : "clippy" ,
3535 cargoArgs : "--all-targets -- -D warnings" ,
36+ cargoCacheKey : "clippy" ,
3637 } ,
3738 test : {
3839 name : "test" ,
3940 cargoCommand : "test" ,
41+ cargoCacheKey : "test" ,
4042 } ,
4143 build : {
4244 name : "build" ,
4345 cargoCommand : "build" ,
46+ cargoCacheKey : "build" ,
4447 } ,
4548 fmt : {
4649 name : "fmt" ,
4750 cargoCommand : "fmt" ,
4851 cargoArgs : "-- --check" ,
49- platformIndependent : true
52+ platformIndependent : true ,
53+ cargoCacheKey : "code" ,
5054 }
5155} ;
5256
Original file line number Diff line number Diff line change 6161 - name : Checkout
6262 uses : actions/checkout@v2
6363
64+ - name : Cache rustup
65+ uses : actions/cache@v2
66+ with :
67+ path : |
68+ /usr/share/rust/.rustup
69+ key : ${{ runner.os }}-rustup-${{ hashFiles('rust-toolchain.toml') }}
70+
6471 - name : Install rust toolchain
6572 run : rustup show
6673
7885 cargo clippy --version
7986 env
8087
88+ - name : Cache cargo
89+ uses : actions/cache@v2
90+ with :
91+ path : |
92+ ~/.cargo/bin/
93+ ~/.cargo/registry/index/
94+ ~/.cargo/registry/cache/
95+ ~/.cargo/git/db/
96+ target/
97+ key : ${{ runner.os }}-cargo-${{ matrix.mode.cargoCacheKey }}-${{ hashFiles('rust-toolchain.toml', 'Cargo.lock') }}
98+
8199 - name : Run cargo ${{ matrix.mode.cargoCommand }}
82100 uses : actions-rs/cargo@v1
83101 with :
You can’t perform that action at this time.
0 commit comments