diff --git a/.github/actions/setup-builder/action.yaml b/.github/actions/setup-builder/action.yaml index 13a3008b74bc..eca1038bf94f 100644 --- a/.github/actions/setup-builder/action.yaml +++ b/.github/actions/setup-builder/action.yaml @@ -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: | @@ -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 diff --git a/.github/workflows/miri.yaml b/.github/workflows/miri.yaml index 73dfc0092836..5bfd9f7c3ad3 100644 --- a/.github/workflows/miri.yaml +++ b/.github/workflows/miri.yaml @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -name: Rust +name: MIRI on: # always trigger diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5fa7ec8d68d5..2d435e91e850 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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 @@ -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: @@ -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: @@ -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: @@ -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: @@ -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) @@ -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 @@ -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: @@ -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