Skip to content

Commit

Permalink
ci: simplify Rust builds
Browse files Browse the repository at this point in the history
  • Loading branch information
lidavidm committed Dec 27, 2024
1 parent 63b3176 commit d1ab10d
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,10 @@ permissions:

defaults:
run:
shell: bash
working-directory: rust
shell: bash -l {0}

jobs:
native-unix:
uses: ./.github/workflows/native-unix.yml
permissions:
contents: read
id-token: write

rust:
needs: [native-unix]
strategy:
matrix:
# TODO(alexandreyc): add `windows-latest`
Expand All @@ -72,7 +64,7 @@ jobs:
rustup default stable
- name: Get required Go version
run: |
(. ../.env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
(. ./.env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
- uses: actions/setup-go@v5
with:
go-version: "${{ env.GO_VERSION }}"
Expand All @@ -91,39 +83,50 @@ jobs:
curl -L "https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protoc-28.3-osx-universal_binary.zip" -o protoc.zip
unzip "protoc.zip" -d $HOME/.local
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- uses: actions/download-artifact@v4
with:
name: driver-manager-${{ matrix.os }}
path: "~"
- name: Untar artifacts
- name: Build C++/Go drivers
shell: bash -l {0}
run: |
cd
mkdir -p ${{ github.workspace }}/build
tar xvf ~/local.tgz -C ${{ github.workspace }}/build --strip-components=1
mkdir -p build
mkdir -p local
pushd build
cmake -DADBC_USE_ASAN=OFF -DADBC_USE_UBSAN=OFF -DCMAKE_BUILD_TYPE=Release -DADBC_BUILD_TESTS=OFF -DCMAKE_PREFIX_PATH=../local ../c
cmake --build . --target install
popd
- name: Set dynamic linker path
if: matrix.os == 'ubuntu-latest'
run: |
echo "LD_LIBRARY_PATH=${{ github.workspace }}/build/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${{ github.workspace }}/arrow-adbc/local/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV"
- name: Set dynamic linker path
if: matrix.os == 'macos-latest'
run: |
echo "DYLD_LIBRARY_PATH=/opt/homebrew/opt/sqlite/lib:${{ github.workspace }}/build/lib:$DYLD_LIBRARY_PATH" >> "$GITHUB_ENV"
echo "DYLD_LIBRARY_PATH=/opt/homebrew/opt/sqlite/lib:${{ github.workspace }}/arrow-adbc/local/lib:$DYLD_LIBRARY_PATH" >> "$GITHUB_ENV"
- name: Set dynamic linker path
if: matrix.os == 'macos-13'
run: |
echo "DYLD_LIBRARY_PATH=/usr/local/opt/sqlite/lib:${{ github.workspace }}/build/lib:$DYLD_LIBRARY_PATH" >> "$GITHUB_ENV"
echo "DYLD_LIBRARY_PATH=/usr/local/opt/sqlite/lib:${{ github.workspace }}/arrow-adbc/local/lib:$DYLD_LIBRARY_PATH" >> "$GITHUB_ENV"
- name: Set search dir for Snowflake Go lib
run: echo "ADBC_SNOWFLAKE_GO_LIB_DIR=${{ github.workspace }}/build/lib" >> "$GITHUB_ENV"
run: echo "ADBC_SNOWFLAKE_GO_LIB_DIR=${{ github.workspace }}/arrow-adbc/local/lib" >> "$GITHUB_ENV"
- name: Clippy
run: cargo clippy --workspace --all-targets --all-features -- -Dwarnings
run: |
pushd rust
cargo clippy --workspace --all-targets --all-features -- -Dwarnings
popd
- name: Test
run: cargo test --workspace --all-targets --all-features
run: |
pushd rust
cargo test --workspace --all-targets --all-features
popd
# env:
# ADBC_SNOWFLAKE_TESTS: 1
# ADBC_SNOWFLAKE_URI: ${{ secrets.SNOWFLAKE_URI }}
# ADBC_SNOWFLAKE_SQL_DB: ADBC_TESTING
- name: Doctests
run: cargo test --workspace --doc --all-features
run: |
pushd rust
cargo test --workspace --doc --all-features
popd
- name: Check docs
run: cargo doc --workspace --all-features
run: |
pushd rust
cargo doc --workspace --all-features
popd

0 comments on commit d1ab10d

Please sign in to comment.