Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/actions/check-rebuild/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Build and verify rebuild is a no-op"
description: "Run a cargo command, then re-run it to verify all artifacts are cached"
inputs:
command:
description: "The cargo build command to run and verify (--message-format json is appended on the verification run)"
required: true
runs:
using: "composite"
steps:
- name: "Build"
shell: bash
run: ${{ inputs.command }}
- name: "Verify rebuild is a no-op"
shell: bash
run: |
stale=$(${{ inputs.command }} \
--message-format json 2>/dev/null \
| jq -r 'select(.reason == "compiler-artifact" and .fresh == false) | .target.name')
if [ -n "$stale" ]; then
echo "ERROR: Rebuild recompiled crates that should have been cached:"
echo "$stale"
exit 1
fi
30 changes: 19 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,9 @@ jobs:
run: rustup target add wasm32-unknown-unknown
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Rust Build (${{matrix.config.name}})
run: ${{matrix.config.env.rustflags}} cargo hack build --locked ${{matrix.config.args}} --ignore-private
- uses: ./.github/actions/check-rebuild
with:
command: "${{matrix.config.env.rustflags}} cargo hack build --locked ${{matrix.config.args}} --ignore-private"
- name: "Make sure no files changed after build"
run: |
git status --porcelain
Expand Down Expand Up @@ -497,14 +498,12 @@ jobs:
- uses: ./.github/actions/setup-rust
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build CUDA crates
run: |
cargo build --locked --all-features --all-targets \
-p vortex-cuda \
-p vortex-cub \
-p vortex-nvcomp \
-p gpu-scan-cli \
-p vortex-test-e2e-cuda
- uses: ./.github/actions/check-rebuild
with:
command: >-
cargo build --locked --all-features --all-targets
-p vortex-cuda -p vortex-cub -p vortex-nvcomp
-p gpu-scan-cli -p vortex-test-e2e-cuda
- name: Clippy CUDA crates
run: |
cargo clippy --locked --all-features --all-targets \
Expand Down Expand Up @@ -658,6 +657,10 @@ jobs:
if: matrix.os != 'windows-x64'
run: |
cargo nextest run --locked --workspace --all-features --no-fail-fast --exclude vortex-bench --exclude xtask --exclude vortex-sqllogictest
- uses: ./.github/actions/check-rebuild
if: matrix.os != 'windows-x64'
with:
command: "cargo test --locked --workspace --all-features --no-run --exclude vortex-bench --exclude xtask --exclude vortex-sqllogictest"

- name: Alert incident.io
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/develop'
Expand Down Expand Up @@ -780,6 +783,9 @@ jobs:
cmake -S vortex-cxx/examples -B vortex-cxx/examples/build -DCMAKE_BUILD_TYPE=Release
cmake --build vortex-cxx/examples/build --parallel $(nproc)
vortex-cxx/examples/build/hello-vortex vortex-cxx/examples/goldenfiles/example.vortex
- uses: ./.github/actions/check-rebuild
with:
command: "cargo build --locked -p vortex-cxx --lib"

sqllogic-test:
name: "SQL logic tests"
Expand All @@ -805,7 +811,9 @@ jobs:
run: |
./vortex-sqllogictest/slt/tpch/generate_data.sh
cargo test -p vortex-sqllogictest --test sqllogictests

- uses: ./.github/actions/check-rebuild
with:
command: "cargo test -p vortex-sqllogictest --test sqllogictests --no-run"

wasm-integration:
name: "wasm-integration"
Expand Down
8 changes: 7 additions & 1 deletion vortex-duckdb/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,13 @@ fn c2rust(crate_dir: &Path, duckdb_include_dir: &Path) {
exit(1);
}
};
if let Err(e) = bindings.write_to_file(crate_dir.join("src/cpp.rs")) {
let out_path = crate_dir.join("src/cpp.rs");
let new_contents = bindings.to_string();
let write = match fs::read_to_string(&out_path) {
Ok(existing) => existing != new_contents,
Err(_) => true,
};
if write && let Err(e) = fs::write(&out_path, new_contents) {
println!("cargo:error=Failed to write Rust bindings: {e}");
exit(1);
}
Expand Down
Loading