Skip to content

Commit

Permalink
Rework caching
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Jun 9, 2022
1 parent b020e6e commit ed413af
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 87 deletions.
21 changes: 21 additions & 0 deletions .github/actions/setup-builder/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@ inputs:
runs:
using: "composite"
steps:
- name: Cache Cargo
uses: actions/cache@v3
with:
# these represent dependencies downloaded by cargo
# and thus do not depend on the OS, arch nor rust version.
#
# source https://github.com/actions/cache/blob/main/examples.md#rust---cargo
path: |
/usr/local/cargo/bin/
/usr/local/cargo/registry/index/
/usr/local/cargo/registry/cache/
/usr/local/cargo/git/db/
key: cargo-cache3-
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
# these represent compiled steps of both dependencies and arrow
# and thus are specific for a particular OS, arch and rust version.
path: /github/home/target
key: ${{ runner.os }}-${{ runner.arch }}-target-cache3-${{ inputs.rust-version }}-
- name: Install Build Dependencies
shell: bash
run: |
Expand All @@ -37,3 +57,4 @@ runs:
rustup toolchain install ${{ inputs.rust-version }}
rustup default ${{ inputs.rust-version }}
rustup component add rustfmt
echo "CARGO_TARGET_DIR=/github/home/target" >> $GITHUB_ENV
2 changes: 1 addition & 1 deletion .github/workflows/miri.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

name: Rust
name: MIRI

on:
# always trigger
Expand Down
88 changes: 2 additions & 86 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,12 @@ jobs:
RUSTFLAGS: "-C debuginfo=1"
steps:
- uses: actions/checkout@v2
- name: Cache Cargo
uses: actions/cache@v3
with:
# these represent dependencies downloaded by cargo
# and thus do not depend on the OS, arch nor rust version.
path: /github/home/.cargo
key: cargo-cache3-
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
# these represent compiled steps of both dependencies and arrow
# and thus are specific for a particular OS, arch and rust version.
path: /github/home/target
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache3-${{ matrix.rust }}-
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: ${{ matrix.rust }}
- name: Build Workspace
run: |
export CARGO_HOME="/github/home/.cargo"
export CARGO_TARGET_DIR="/github/home/target"
cargo build
# test the crate
Expand All @@ -81,24 +65,10 @@ jobs:
RUSTFLAGS: "-C debuginfo=1"
ARROW_TEST_DATA: /__w/arrow-rs/arrow-rs/testing/data
PARQUET_TEST_DATA: /__w/arrow-rs/arrow-rs/parquet-testing/data
CARGO_HOME: /github/home/.cargo
CARGO_TARGET_DIR: /github/home/target
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Cache Cargo
uses: actions/cache@v3
with:
path: /github/home/.cargo
# this key equals the ones on `linux-build-lib` for re-use
key: cargo-cache3-
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: /github/home/target
# this key equals the ones on `linux-build-lib` for re-use
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache3-${{ matrix.rust }}
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
Expand Down Expand Up @@ -161,22 +131,10 @@ jobs:
# "1" means line tables only, which is useful for panic tracebacks.
RUSTFLAGS: "-C debuginfo=1"
ARROW_TEST_DATA: /__w/arrow-rs/arrow-rs/testing/data
CARGO_HOME: /github/home/.cargo
CARGO_TARGET_DIR: /github/home/target
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Cache Cargo
uses: actions/cache@v3
with:
path: /github/home/.cargo
key: cargo-nightly-cache3-
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: /github/home/target
key: ${{ runner.os }}-${{ matrix.arch }}-target-nightly-cache3-${{ matrix.rust }}
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
Expand Down Expand Up @@ -234,18 +192,6 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- name: Cache Cargo
uses: actions/cache@v3
with:
path: /github/home/.cargo
# this key equals the ones on `linux-build-lib` for re-use
key: cargo-cache3-
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: /github/home/target
# this key equals the ones on `linux-build-lib` for re-use
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache3-${{ matrix.rust }}
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
Expand All @@ -255,8 +201,6 @@ jobs:
rustup component add rustfmt clippy
- name: Run clippy
run: |
export CARGO_HOME="/github/home/.cargo"
export CARGO_TARGET_DIR="/github/home/target"
cargo clippy --features test_common --features prettyprint --features=async --all-targets --workspace -- -D warnings
check_benches:
Expand All @@ -276,27 +220,13 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- name: Cache Cargo
uses: actions/cache@v3
with:
path: /github/home/.cargo
# this key equals the ones on `linux-build-lib` for re-use
key: cargo-cache3-
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: /github/home/target
# this key equals the ones on `linux-build-lib` for re-use
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache3-${{ matrix.rust }}
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: ${{ matrix.rust }}
- name: Check benchmarks
run: |
export CARGO_HOME="/github/home/.cargo"
export CARGO_TARGET_DIR="/github/home/target"
cargo check --benches --workspace --features test_common,prettyprint,async,experimental
cargo check --benches --workspace --features test_common,prettyprint,async,experimental
lint:
name: Lint (cargo fmt)
Expand Down Expand Up @@ -396,8 +326,6 @@ jobs:
rustup target add wasm32-wasi
- name: Build arrow crate
run: |
export CARGO_HOME="/github/home/.cargo"
export CARGO_TARGET_DIR="/github/home/target"
cd arrow
cargo build --no-default-features --features=csv,ipc,simd --target wasm32-unknown-unknown
cargo build --no-default-features --features=csv,ipc,simd --target wasm32-wasi
Expand All @@ -416,6 +344,7 @@ jobs:
# Disable full debug symbol generation to speed up CI build and keep memory down
# "1" means line tables only, which is useful for panic tracebacks.
RUSTFLAGS: "-C debuginfo=1"
RUSTDOCFLAGS: "-Dwarnings"
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -424,23 +353,10 @@ jobs:
run: |
apt update
apt install -y libpython3.9-dev
- name: Cache Cargo
uses: actions/cache@v3
with:
path: /github/home/.cargo
key: cargo-nightly-cache3-
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: /github/home/target
key: ${{ runner.os }}-${{ matrix.arch }}-target-nightly-cache3-${{ matrix.rust }}
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: ${{ matrix.rust }}
- name: Run cargo doc
run: |
export CARGO_HOME="/github/home/.cargo"
export CARGO_TARGET_DIR="/github/home/target"
export RUSTDOCFLAGS="-Dwarnings"
cargo doc --document-private-items --no-deps --workspace --all-features

0 comments on commit ed413af

Please sign in to comment.