@@ -23,6 +23,8 @@ concurrency:
2323
2424on :
2525 push :
26+ branches :
27+ - main
2628 paths-ignore :
2729 - " doc/**"
2830 - " docs/**"
8486 ~/.cargo/registry
8587 ~/.cargo/git
8688 native/target
87- key : ${{ runner.os }}-cargo-ci-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}
89+ key : ${{ runner.os }}-cargo-ci-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}-${{ hashFiles('native/**/*.rs') }}
8890 restore-keys : |
89- ${{ runner.os }}-cargo-ci-
91+ ${{ runner.os }}-cargo-ci-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}-
9092
9193 - name : Build native library (CI profile)
9294 run : |
@@ -112,7 +114,7 @@ jobs:
112114 ~/.cargo/registry
113115 ~/.cargo/git
114116 native/target
115- key : ${{ runner.os }}-cargo-ci-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}
117+ key : ${{ runner.os }}-cargo-ci-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}-${{ hashFiles('native/**/*.rs') }}
116118
117119 # Run Rust tests (runs in parallel with build-native, uses debug builds)
118120 linux-test-rust :
@@ -138,9 +140,9 @@ jobs:
138140 ~/.cargo/git
139141 native/target
140142 # Note: Java version intentionally excluded - Rust target is JDK-independent
141- key : ${{ runner.os }}-cargo-debug-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}
143+ key : ${{ runner.os }}-cargo-debug-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}-${{ hashFiles('native/**/*.rs') }}
142144 restore-keys : |
143- ${{ runner.os }}-cargo-debug-
145+ ${{ runner.os }}-cargo-debug-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}-
144146
145147 - name : Rust test steps
146148 uses : ./.github/actions/rust-test
@@ -153,7 +155,7 @@ jobs:
153155 ~/.cargo/registry
154156 ~/.cargo/git
155157 native/target
156- key : ${{ runner.os }}-cargo-debug-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}
158+ key : ${{ runner.os }}-cargo-debug-${{ hashFiles('native/**/Cargo.lock', 'native/**/Cargo.toml') }}-${{ hashFiles('native/**/*.rs') }}
157159
158160 linux-test :
159161 needs : build-native
0 commit comments