Skip to content

Commit 6159f97

Browse files
authored
Add Rust caching to PR workflow to improve performance (#460)
* Add Rust caching to PR workflow to improve performance * Use a Acitons feature matrix to improve build times (#458) --------- Signed-off-by: Luke Kim <[email protected]>
1 parent cbfa97c commit 6159f97

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

.github/workflows/pr.yaml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717

1818
- uses: dtolnay/rust-toolchain@stable
1919

20+
- name: Cache Rust dependencies
21+
uses: Swatinem/rust-cache@v2
22+
2023
- name: Install Protoc
2124
uses: arduino/setup-protoc@v3
2225
with:
@@ -44,6 +47,9 @@ jobs:
4447

4548
- uses: dtolnay/rust-toolchain@stable
4649

50+
- name: Cache Rust dependencies
51+
uses: Swatinem/rust-cache@v2
52+
4753
- name: Build with ${{ matrix.features }}
4854
run: |
4955
if [ "${{ matrix.features }}" = "no-default-features" ]; then
@@ -65,6 +71,9 @@ jobs:
6571

6672
- uses: dtolnay/rust-toolchain@stable
6773

74+
- name: Cache Rust dependencies
75+
uses: Swatinem/rust-cache@v2
76+
6877
- name: Pull the Postgres/MySQL images
6978
run: |
7079
docker pull ${{ env.PG_DOCKER_IMAGE }}
@@ -116,23 +125,28 @@ jobs:
116125

117126
- uses: dtolnay/rust-toolchain@stable
118127

128+
- name: Cache Rust dependencies
129+
uses: Swatinem/rust-cache@v2
130+
with:
131+
workspaces: |
132+
.
133+
python
134+
119135
- uses: astral-sh/setup-uv@v5
120136
with:
121137
enable-cache: true
138+
cache-dependency-glob: 'python/pyproject.toml'
122139

123140
- name: Install ODBC, Sqlite and Roapi
124141
run: |
125142
sudo apt-get install -y unixodbc-dev libsqliteodbc
126143
sudo apt-get install -y libsqlite3-dev
127144
cargo install --locked --git https://github.com/roapi/roapi --branch main --bins roapi
128145
129-
- name: Build Python package
146+
- name: Build Python package and run tests
130147
run: |
131148
cd python
132149
uv sync --dev --no-install-package datafusion
133-
uv run --no-project maturin develop --uv
134-
135-
- name: Run Python tests
136-
run: |
137-
cd python/python/tests
150+
uv run --no-project maturin develop --uv --release
151+
cd python/tests
138152
uv run --no-project pytest -v .

0 commit comments

Comments
 (0)