diff --git a/.github/actions/setup-builder/action.yaml b/.github/actions/setup-builder/action.yaml index 22d2f2187dd0..a83a4f21fbdf 100644 --- a/.github/actions/setup-builder/action.yaml +++ b/.github/actions/setup-builder/action.yaml @@ -17,14 +17,13 @@ name: Prepare Rust Builder description: 'Prepare Rust Build Environment' -inputs: - rust-version: - description: 'version of rust to install (e.g. stable)' - required: true - default: 'stable' runs: using: "composite" steps: + - uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 1 - name: Install Build Dependencies shell: bash run: | @@ -36,9 +35,9 @@ runs: # rustfmt is needed for the substrait build script run: | RETRY=("ci/scripts/retry" timeout 120) - echo "Installing ${{ inputs.rust-version }}" - "${RETRY[@]}" rustup toolchain install ${{ inputs.rust-version }} - "${RETRY[@]}" rustup default ${{ inputs.rust-version }} + echo "Installing Rust ..." + # install toolchain specified by rust-toolchain.toml + "${RETRY[@]}" rustup toolchain install "${RETRY[@]}" rustup component add rustfmt - name: Configure rust runtime env uses: ./.github/actions/setup-rust-runtime diff --git a/.github/actions/setup-macos-aarch64-builder/action.yaml b/.github/actions/setup-macos-aarch64-builder/action.yaml index 288799a284b0..8616cb5b91dc 100644 --- a/.github/actions/setup-macos-aarch64-builder/action.yaml +++ b/.github/actions/setup-macos-aarch64-builder/action.yaml @@ -17,14 +17,13 @@ name: Prepare Rust Builder for MacOS description: 'Prepare Rust Build Environment for MacOS' -inputs: - rust-version: - description: 'version of rust to install (e.g. stable)' - required: true - default: 'stable' runs: using: "composite" steps: + - uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 1 - name: Install protobuf compiler shell: bash run: | @@ -39,9 +38,7 @@ runs: - name: Setup Rust toolchain shell: bash run: | - rustup update stable - rustup toolchain install stable - rustup default stable + rustup toolchain install rustup component add rustfmt - name: Setup rust cache uses: Swatinem/rust-cache@v2 diff --git a/.github/actions/setup-macos-builder/action.yaml b/.github/actions/setup-macos-builder/action.yaml index fffdab160b04..079536348e68 100644 --- a/.github/actions/setup-macos-builder/action.yaml +++ b/.github/actions/setup-macos-builder/action.yaml @@ -17,14 +17,13 @@ name: Prepare Rust Builder for MacOS description: 'Prepare Rust Build Environment for MacOS' -inputs: - rust-version: - description: 'version of rust to install (e.g. stable)' - required: true - default: 'stable' runs: using: "composite" steps: + - uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 1 - name: Install protobuf compiler shell: bash run: | @@ -39,9 +38,8 @@ runs: - name: Setup Rust toolchain shell: bash run: | - rustup update stable - rustup toolchain install stable - rustup default stable + # install version of rust in rust-toolchain.toml + rustup toolchain install rustup component add rustfmt - name: Configure rust runtime env uses: ./.github/actions/setup-rust-runtime diff --git a/.github/workflows/extended.yml b/.github/workflows/extended.yml index 3f882d7a3a82..8646a6baed2a 100644 --- a/.github/workflows/extended.yml +++ b/.github/workflows/extended.yml @@ -28,8 +28,11 @@ concurrency: # # We still run them as they provide important coverage to ensure correctness # in the (very rare) event of a hash failure or sqlite library query failure. -on: - push: + +# TEMP for testing +on: [push, pull_request] +# on: +# push: jobs: # Check crate compiles and base cargo check passes @@ -41,13 +44,10 @@ jobs: with: submodules: true fetch-depth: 1 - - name: Install Rust - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - source $HOME/.cargo/env - rustup default stable - - name: Install Protobuf Compiler - run: sudo apt-get install -y protobuf-compiler + - name: Setup Rust toolchain + uses: ./.github/actions/setup-builder + with: + rust-version: stable - name: Prepare cargo build run: | cargo check --profile ci --all-targets @@ -65,13 +65,10 @@ jobs: fetch-depth: 1 - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be - - name: Install Rust - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - source $HOME/.cargo/env - rustup default stable - - name: Install Protobuf Compiler - run: sudo apt-get install -y protobuf-compiler + - name: Setup Rust toolchain + uses: ./.github/actions/setup-builder + with: + rust-version: stable # For debugging, test binaries can be large. - name: Show available disk space run: | diff --git a/dev/release/verify-release-candidate.sh b/dev/release/verify-release-candidate.sh index 2c0bd216b3ac..a053569dcb24 100755 --- a/dev/release/verify-release-candidate.sh +++ b/dev/release/verify-release-candidate.sh @@ -117,8 +117,11 @@ test_source_distribution() { # build and test rust + # install the needed version of rust defined in rust-toolchain.toml + rustup toolchain install + # raises on any formatting errors - rustup component add rustfmt --toolchain stable + rustup component add rustfmt cargo fmt --all -- --check # Clone testing repositories into the expected location