From 72334d4958b87cffe76b908b6d46032c43888464 Mon Sep 17 00:00:00 2001
From: David Li
Date: Thu, 26 Dec 2024 19:32:56 -0500
Subject: [PATCH] ci: simplify Rust builds
Fixes #2399.
---
.github/workflows/rust.yml | 45 ++++++++++++++++++++------------------
1 file changed, 24 insertions(+), 21 deletions(-)
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index ab0554fe2b..1453d08f02 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -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`
@@ -91,16 +83,15 @@ 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: |
@@ -116,14 +107,26 @@ jobs:
- name: Set search dir for Snowflake Go lib
run: echo "ADBC_SNOWFLAKE_GO_LIB_DIR=${{ github.workspace }}/build/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