Skip to content

Commit ed413af

Browse files
committed
Rework caching
1 parent b020e6e commit ed413af

File tree

3 files changed

+24
-87
lines changed

3 files changed

+24
-87
lines changed

.github/actions/setup-builder/action.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,26 @@ inputs:
2525
runs:
2626
using: "composite"
2727
steps:
28+
- name: Cache Cargo
29+
uses: actions/cache@v3
30+
with:
31+
# these represent dependencies downloaded by cargo
32+
# and thus do not depend on the OS, arch nor rust version.
33+
#
34+
# source https://github.com/actions/cache/blob/main/examples.md#rust---cargo
35+
path: |
36+
/usr/local/cargo/bin/
37+
/usr/local/cargo/registry/index/
38+
/usr/local/cargo/registry/cache/
39+
/usr/local/cargo/git/db/
40+
key: cargo-cache3-
41+
- name: Cache Rust dependencies
42+
uses: actions/cache@v3
43+
with:
44+
# these represent compiled steps of both dependencies and arrow
45+
# and thus are specific for a particular OS, arch and rust version.
46+
path: /github/home/target
47+
key: ${{ runner.os }}-${{ runner.arch }}-target-cache3-${{ inputs.rust-version }}-
2848
- name: Install Build Dependencies
2949
shell: bash
3050
run: |
@@ -37,3 +57,4 @@ runs:
3757
rustup toolchain install ${{ inputs.rust-version }}
3858
rustup default ${{ inputs.rust-version }}
3959
rustup component add rustfmt
60+
echo "CARGO_TARGET_DIR=/github/home/target" >> $GITHUB_ENV

.github/workflows/miri.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
name: Rust
18+
name: MIRI
1919

2020
on:
2121
# always trigger

.github/workflows/rust.yml

+2-86
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,12 @@ jobs:
4040
RUSTFLAGS: "-C debuginfo=1"
4141
steps:
4242
- uses: actions/checkout@v2
43-
- name: Cache Cargo
44-
uses: actions/cache@v3
45-
with:
46-
# these represent dependencies downloaded by cargo
47-
# and thus do not depend on the OS, arch nor rust version.
48-
path: /github/home/.cargo
49-
key: cargo-cache3-
50-
- name: Cache Rust dependencies
51-
uses: actions/cache@v3
52-
with:
53-
# these represent compiled steps of both dependencies and arrow
54-
# and thus are specific for a particular OS, arch and rust version.
55-
path: /github/home/target
56-
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache3-${{ matrix.rust }}-
5743
- name: Setup Rust toolchain
5844
uses: ./.github/actions/setup-builder
5945
with:
6046
rust-version: ${{ matrix.rust }}
6147
- name: Build Workspace
6248
run: |
63-
export CARGO_HOME="/github/home/.cargo"
64-
export CARGO_TARGET_DIR="/github/home/target"
6549
cargo build
6650
6751
# test the crate
@@ -81,24 +65,10 @@ jobs:
8165
RUSTFLAGS: "-C debuginfo=1"
8266
ARROW_TEST_DATA: /__w/arrow-rs/arrow-rs/testing/data
8367
PARQUET_TEST_DATA: /__w/arrow-rs/arrow-rs/parquet-testing/data
84-
CARGO_HOME: /github/home/.cargo
85-
CARGO_TARGET_DIR: /github/home/target
8668
steps:
8769
- uses: actions/checkout@v2
8870
with:
8971
submodules: true
90-
- name: Cache Cargo
91-
uses: actions/cache@v3
92-
with:
93-
path: /github/home/.cargo
94-
# this key equals the ones on `linux-build-lib` for re-use
95-
key: cargo-cache3-
96-
- name: Cache Rust dependencies
97-
uses: actions/cache@v3
98-
with:
99-
path: /github/home/target
100-
# this key equals the ones on `linux-build-lib` for re-use
101-
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache3-${{ matrix.rust }}
10272
- name: Setup Rust toolchain
10373
uses: ./.github/actions/setup-builder
10474
with:
@@ -161,22 +131,10 @@ jobs:
161131
# "1" means line tables only, which is useful for panic tracebacks.
162132
RUSTFLAGS: "-C debuginfo=1"
163133
ARROW_TEST_DATA: /__w/arrow-rs/arrow-rs/testing/data
164-
CARGO_HOME: /github/home/.cargo
165-
CARGO_TARGET_DIR: /github/home/target
166134
steps:
167135
- uses: actions/checkout@v2
168136
with:
169137
submodules: true
170-
- name: Cache Cargo
171-
uses: actions/cache@v3
172-
with:
173-
path: /github/home/.cargo
174-
key: cargo-nightly-cache3-
175-
- name: Cache Rust dependencies
176-
uses: actions/cache@v3
177-
with:
178-
path: /github/home/target
179-
key: ${{ runner.os }}-${{ matrix.arch }}-target-nightly-cache3-${{ matrix.rust }}
180138
- name: Setup Rust toolchain
181139
uses: ./.github/actions/setup-builder
182140
with:
@@ -234,18 +192,6 @@ jobs:
234192
- uses: actions/checkout@v2
235193
with:
236194
submodules: true
237-
- name: Cache Cargo
238-
uses: actions/cache@v3
239-
with:
240-
path: /github/home/.cargo
241-
# this key equals the ones on `linux-build-lib` for re-use
242-
key: cargo-cache3-
243-
- name: Cache Rust dependencies
244-
uses: actions/cache@v3
245-
with:
246-
path: /github/home/target
247-
# this key equals the ones on `linux-build-lib` for re-use
248-
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache3-${{ matrix.rust }}
249195
- name: Setup Rust toolchain
250196
uses: ./.github/actions/setup-builder
251197
with:
@@ -255,8 +201,6 @@ jobs:
255201
rustup component add rustfmt clippy
256202
- name: Run clippy
257203
run: |
258-
export CARGO_HOME="/github/home/.cargo"
259-
export CARGO_TARGET_DIR="/github/home/target"
260204
cargo clippy --features test_common --features prettyprint --features=async --all-targets --workspace -- -D warnings
261205
262206
check_benches:
@@ -276,27 +220,13 @@ jobs:
276220
- uses: actions/checkout@v2
277221
with:
278222
submodules: true
279-
- name: Cache Cargo
280-
uses: actions/cache@v3
281-
with:
282-
path: /github/home/.cargo
283-
# this key equals the ones on `linux-build-lib` for re-use
284-
key: cargo-cache3-
285-
- name: Cache Rust dependencies
286-
uses: actions/cache@v3
287-
with:
288-
path: /github/home/target
289-
# this key equals the ones on `linux-build-lib` for re-use
290-
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache3-${{ matrix.rust }}
291223
- name: Setup Rust toolchain
292224
uses: ./.github/actions/setup-builder
293225
with:
294226
rust-version: ${{ matrix.rust }}
295227
- name: Check benchmarks
296228
run: |
297-
export CARGO_HOME="/github/home/.cargo"
298-
export CARGO_TARGET_DIR="/github/home/target"
299-
cargo check --benches --workspace --features test_common,prettyprint,async,experimental
229+
cargo check --benches --workspace --features test_common,prettyprint,async,experimental
300230
301231
lint:
302232
name: Lint (cargo fmt)
@@ -396,8 +326,6 @@ jobs:
396326
rustup target add wasm32-wasi
397327
- name: Build arrow crate
398328
run: |
399-
export CARGO_HOME="/github/home/.cargo"
400-
export CARGO_TARGET_DIR="/github/home/target"
401329
cd arrow
402330
cargo build --no-default-features --features=csv,ipc,simd --target wasm32-unknown-unknown
403331
cargo build --no-default-features --features=csv,ipc,simd --target wasm32-wasi
@@ -416,6 +344,7 @@ jobs:
416344
# Disable full debug symbol generation to speed up CI build and keep memory down
417345
# "1" means line tables only, which is useful for panic tracebacks.
418346
RUSTFLAGS: "-C debuginfo=1"
347+
RUSTDOCFLAGS: "-Dwarnings"
419348
steps:
420349
- uses: actions/checkout@v2
421350
with:
@@ -424,23 +353,10 @@ jobs:
424353
run: |
425354
apt update
426355
apt install -y libpython3.9-dev
427-
- name: Cache Cargo
428-
uses: actions/cache@v3
429-
with:
430-
path: /github/home/.cargo
431-
key: cargo-nightly-cache3-
432-
- name: Cache Rust dependencies
433-
uses: actions/cache@v3
434-
with:
435-
path: /github/home/target
436-
key: ${{ runner.os }}-${{ matrix.arch }}-target-nightly-cache3-${{ matrix.rust }}
437356
- name: Setup Rust toolchain
438357
uses: ./.github/actions/setup-builder
439358
with:
440359
rust-version: ${{ matrix.rust }}
441360
- name: Run cargo doc
442361
run: |
443-
export CARGO_HOME="/github/home/.cargo"
444-
export CARGO_TARGET_DIR="/github/home/target"
445-
export RUSTDOCFLAGS="-Dwarnings"
446362
cargo doc --document-private-items --no-deps --workspace --all-features

0 commit comments

Comments
 (0)