|
1 | 1 | name: build |
2 | 2 |
|
3 | 3 | on: |
| 4 | + pull_request: |
| 5 | + paths: |
| 6 | + - .github/workflows/build.yml |
4 | 7 | workflow_call: |
5 | 8 | inputs: |
6 | 9 | version: |
|
73 | 76 | echo "OS=${os:-'unknown'}" >> $GITHUB_ENV |
74 | 77 | echo "ARCH=${arch:-'unknown'}" >> $GITHUB_ENV |
75 | 78 |
|
| 79 | + - name: Cache rustup toolchain |
| 80 | + uses: actions/cache@v4 |
| 81 | + with: |
| 82 | + path: | |
| 83 | + ~/.rustup |
| 84 | + key: ${{ runner.os }}-${{ matrix.platform.target }}-rustup-${{ hashFiles('rust-toolchain.toml') }} |
| 85 | + restore-keys: | |
| 86 | + ${{ runner.os }}-${{ matrix.platform.target }}-rustup- |
| 87 | +
|
| 88 | + - name: Cache Homebrew packages (macOS) |
| 89 | + if: ${{ runner.os == 'macOS' }} |
| 90 | + uses: actions/cache@v4 |
| 91 | + with: |
| 92 | + path: | |
| 93 | + ~/Library/Caches/Homebrew |
| 94 | + key: ${{ runner.os }}-${{ matrix.platform.target }}-homebrew-${{ hashFiles('.github/workflows/build.yml') }} |
| 95 | + restore-keys: | |
| 96 | + ${{ runner.os }}-${{ matrix.platform.target }}-homebrew- |
| 97 | +
|
76 | 98 | - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c |
77 | 99 | with: |
78 | 100 | cache: ${{ !startsWith(github.ref, 'refs/tags/') }} |
@@ -193,19 +215,6 @@ jobs: |
193 | 215 | with: |
194 | 216 | python-version: 3.x |
195 | 217 |
|
196 | | - - uses: actions/cache@v4 |
197 | | - with: |
198 | | - path: | |
199 | | - ~/.cargo/bin/ |
200 | | - ~/.cargo/registry/index/ |
201 | | - ~/.cargo/registry/cache/ |
202 | | - ~/.cargo/git/db/ |
203 | | - target/ |
204 | | - key: ${{ runner.os }}-cargo-wheels-${{ matrix.platform.target }}-${{ hashFiles('**/Cargo. lock') }} |
205 | | - restore-keys: | |
206 | | - ${{ runner.os }}-cargo-wheels-${{ matrix.platform.target }}- |
207 | | - ${{ runner.os }}-cargo-wheels- |
208 | | -
|
209 | 218 | - name: Build wheels |
210 | 219 | uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 |
211 | 220 | with: |
@@ -238,19 +247,6 @@ jobs: |
238 | 247 | with: |
239 | 248 | python-version: 3.x |
240 | 249 |
|
241 | | - - uses: actions/cache@v4 |
242 | | - with: |
243 | | - path: | |
244 | | - ~/.cargo/bin/ |
245 | | - ~/.cargo/registry/index/ |
246 | | - ~/.cargo/registry/cache/ |
247 | | - ~/.cargo/git/db/ |
248 | | - target/ |
249 | | - key: ${{ runner.os }}-cargo-wheels-${{ matrix.platform.target }}-${{ hashFiles('**/Cargo. lock') }} |
250 | | - restore-keys: | |
251 | | - ${{ runner.os }}-cargo-wheels-${{ matrix.platform.target }}- |
252 | | - ${{ runner.os }}-cargo-wheels- |
253 | | -
|
254 | 250 | - name: Build wheels |
255 | 251 | uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 |
256 | 252 | with: |
@@ -282,15 +278,22 @@ jobs: |
282 | 278 | architecture: ${{ matrix.platform.target }} |
283 | 279 | python-version: 3.x |
284 | 280 |
|
285 | | - - uses: actions/cache@v4 |
| 281 | + - name: Cache rustup toolchain |
| 282 | + uses: actions/cache@v4 |
286 | 283 | with: |
287 | 284 | path: | |
288 | | - ~/.cargo/bin/ |
289 | | - ~/.cargo/registry/index/ |
290 | | - ~/.cargo/registry/cache/ |
291 | | - ~/.cargo/git/db/ |
292 | | - target/ |
293 | | - key: ${{ runner.os }}-cargo-wheels-${{ matrix.platform.target }}-${{ hashFiles('**/Cargo. lock') }} |
| 285 | + ~/.rustup |
| 286 | + key: ${{ runner.os }}-${{ matrix.platform.target }}-rustup-${{ hashFiles('rust-toolchain.toml') }} |
| 287 | + restore-keys: | |
| 288 | + ${{ runner.os }}-${{ matrix.platform.target }}-rustup- |
| 289 | +
|
| 290 | + - name: Cache Cargo registry |
| 291 | + uses: actions/cache@v4 |
| 292 | + with: |
| 293 | + path: | |
| 294 | + ~/.cargo/git |
| 295 | + ~/.cargo/registry |
| 296 | + key: ${{ runner.os }}-cargo-wheels-${{ matrix.platform.target }}-${{ hashFiles('**/Cargo.lock') }} |
294 | 297 | restore-keys: | |
295 | 298 | ${{ runner.os }}-cargo-wheels-${{ matrix.platform.target }}- |
296 | 299 | ${{ runner.os }}-cargo-wheels- |
@@ -326,15 +329,22 @@ jobs: |
326 | 329 | with: |
327 | 330 | python-version: 3.x |
328 | 331 |
|
329 | | - - uses: actions/cache@v4 |
| 332 | + - name: Cache rustup toolchain |
| 333 | + uses: actions/cache@v4 |
| 334 | + with: |
| 335 | + path: | |
| 336 | + ~/.rustup |
| 337 | + key: ${{ runner.os }}-${{ matrix.platform.target }}-rustup-${{ hashFiles('rust-toolchain.toml') }} |
| 338 | + restore-keys: | |
| 339 | + ${{ runner.os }}-${{ matrix.platform.target }}-rustup- |
| 340 | +
|
| 341 | + - name: Cache Cargo registry |
| 342 | + uses: actions/cache@v4 |
330 | 343 | with: |
331 | 344 | path: | |
332 | | - ~/.cargo/bin/ |
333 | | - ~/.cargo/registry/index/ |
334 | | - ~/.cargo/registry/cache/ |
335 | | - ~/.cargo/git/db/ |
336 | | - target/ |
337 | | - key: ${{ runner.os }}-cargo-wheels-${{ matrix.platform.target }}-${{ hashFiles('**/Cargo. lock') }} |
| 345 | + ~/.cargo/git |
| 346 | + ~/.cargo/registry |
| 347 | + key: ${{ runner.os }}-cargo-wheels-${{ matrix.platform.target }}-${{ hashFiles('**/Cargo.lock') }} |
338 | 348 | restore-keys: | |
339 | 349 | ${{ runner.os }}-cargo-wheels-${{ matrix.platform.target }}- |
340 | 350 | ${{ runner.os }}-cargo-wheels- |
|
0 commit comments