Skip to content

Commit fa30fad

Browse files
authored
Improve caching
Mostly saves a bit on the installation of ua-parser-rs by trying to cache both the rust artefacts and the generated wheels. Seems to gain a bit but it's not exactly mind-blowing, at the end of the day not bothering with the source and sdist installs would definitely be a larger gain...
1 parent 3953186 commit fa30fad

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,15 @@ jobs:
106106
- opts: ""
107107
- python-version: graalpy-25
108108
opts: "--experimental-options --engine.CompileOnly='~tregex re'"
109+
- impl: cp
110+
- python-version: "3.14t"
111+
impl: cpt
112+
- python-version: "pypy-3.11"
113+
impl: "pypy-3.11"
114+
- python-version: "graalpy-25"
115+
impl: "graalpy-25"
116+
env:
117+
CARGO_TARGET_DIR: ${{ github.workspace }}/target-rs
109118
steps:
110119
- name: Checkout working copy
111120
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # 6.0.1
@@ -118,6 +127,20 @@ jobs:
118127
with:
119128
python-version: ${{ matrix.python-version }}
120129
allow-prereleases: true
130+
cache: pip
131+
cache-dependency-path: |
132+
pyproject.toml
133+
ua-parser-builtins/pyproject.toml
134+
ua-parser-rs/pyproject.toml
135+
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # 5.0.4
136+
with:
137+
path: |
138+
${{ env.CARGO_TARGET_DIR }}
139+
~/.cargo/registry
140+
~/.cargo/git
141+
key: rs-${{ runner.os }}-${{ matrix.impl }}-${{ hashFiles('ua-parser-rs/Cargo.toml', 'ua-parser-rs/**/*.rs') }}
142+
restore-keys: |
143+
rs-${{ runner.os }}-${{ matrix.impl }}-
121144
- run: python -mpip install --upgrade pip
122145
- run: |
123146
# if binary wheels are not available for the current

0 commit comments

Comments
 (0)