Skip to content

Commit 72cc0be

Browse files
committed
ci: share workspace check artifacts with feature checks
1 parent 82335b4 commit 72cc0be

1 file changed

Lines changed: 50 additions & 11 deletions

File tree

‎.github/workflows/rust.yml‎

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,32 @@ jobs:
7373
- name: Rust Dependency Cache
7474
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
7575
with:
76-
shared-key: "amd-ci-check" # this job uses it's own cache becase check has a separate cache and we need it to be fast as it blocks other jobs
76+
shared-key: "amd-ci-check" # Keep cargo check artifacts separate from test builds.
7777
save-if: ${{ github.ref_name == 'main' }}
7878
- name: Prepare cargo build
7979
# `--locked` asserts that Cargo.lock is up to date with the manifest.
8080
run: cargo xtask ci step check workspace
81+
- name: Archive Cargo check artifacts
82+
id: archive-check
83+
continue-on-error: true
84+
shell: bash
85+
run: |
86+
# Preserve source timestamps so Cargo can reuse workspace crates.
87+
git ls-files -z | tar --null -T - -cf "$RUNNER_TEMP/check-workspace.tar" target
88+
tar -cf "$RUNNER_TEMP/check-registry.tar" -C "$CARGO_HOME" registry
89+
- name: Upload Cargo check artifacts
90+
if: steps.archive-check.outcome == 'success'
91+
continue-on-error: true
92+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
93+
with:
94+
name: cargo-check
95+
path: |
96+
${{ runner.temp }}/check-workspace.tar
97+
${{ runner.temp }}/check-registry.tar
98+
compression-level: 1
99+
retention-days: 1
100+
if-no-files-found: error
101+
overwrite: true
81102

82103
# Check datafusion-common features
83104
#
@@ -111,6 +132,8 @@ jobs:
111132
linux-datafusion-substrait-features:
112133
name: cargo check datafusion-substrait features
113134
needs: linux-build-lib
135+
env:
136+
CARGO_INCREMENTAL: "0"
114137
runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }}
115138
container:
116139
image: amd64/rust
@@ -120,11 +143,18 @@ jobs:
120143
uses: ./.github/actions/setup-builder
121144
with:
122145
rust-version: stable
123-
- name: Rust Dependency Cache
124-
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
125-
with:
126-
save-if: false # set in linux-test
127-
shared-key: "amd-ci"
146+
- name: Download Cargo check artifacts
147+
id: download-check
148+
continue-on-error: true
149+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
150+
with:
151+
name: cargo-check
152+
path: ${{ runner.temp }}/cargo-check
153+
- name: Restore Cargo check artifacts
154+
if: steps.download-check.outcome == 'success'
155+
run: |
156+
tar -xf "$RUNNER_TEMP/cargo-check/check-workspace.tar"
157+
tar -xf "$RUNNER_TEMP/cargo-check/check-registry.tar" -C "$CARGO_HOME"
128158
- name: Check datafusion-substrait (default features)
129159
run: cargo xtask ci step check datafusion-substrait default
130160
#
@@ -200,6 +230,8 @@ jobs:
200230
linux-cargo-check-datafusion:
201231
name: cargo check datafusion features
202232
needs: linux-build-lib
233+
env:
234+
CARGO_INCREMENTAL: "0"
203235
runs-on: ${{ vars.USE_RUNS_ON == 'true' && format('runs-on={0},family=m8a+m7a+c8a,cpu=16,image=ubuntu24-full-x64,extras=s3-cache,disk=large,tag=datafusion', github.run_id) || 'ubuntu-latest' }}
204236
container:
205237
image: amd64/rust
@@ -210,11 +242,18 @@ jobs:
210242
uses: ./.github/actions/setup-builder
211243
with:
212244
rust-version: stable
213-
- name: Rust Dependency Cache
214-
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
215-
with:
216-
save-if: false # set in linux-test
217-
shared-key: "amd-ci"
245+
- name: Download Cargo check artifacts
246+
id: download-check
247+
continue-on-error: true
248+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
249+
with:
250+
name: cargo-check
251+
path: ${{ runner.temp }}/cargo-check
252+
- name: Restore Cargo check artifacts
253+
if: steps.download-check.outcome == 'success'
254+
run: |
255+
tar -xf "$RUNNER_TEMP/cargo-check/check-workspace.tar"
256+
tar -xf "$RUNNER_TEMP/cargo-check/check-registry.tar" -C "$CARGO_HOME"
218257
- name: Check datafusion (default features)
219258
run: cargo xtask ci step check datafusion default
220259
#

0 commit comments

Comments
 (0)