diff --git a/.github/actions/check-rebuild/action.yml b/.github/actions/check-rebuild/action.yml new file mode 100644 index 00000000000..0fef88f9db9 --- /dev/null +++ b/.github/actions/check-rebuild/action.yml @@ -0,0 +1,20 @@ +name: "Check rebuild is a no-op" +description: "Verify that running a cargo build command again produces only fresh (cached) artifacts" +inputs: + command: + description: "The full cargo build command to verify is cached (--message-format json is appended automatically)" + required: true +runs: + using: "composite" + steps: + - name: "Check 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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 045aba9c034..5487f09f899 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -242,6 +242,9 @@ jobs: run: | git status --porcelain test -z "$(git status --porcelain)" + - uses: ./.github/actions/check-rebuild + with: + command: "${{matrix.config.env.rustflags}} cargo hack build --locked ${{matrix.config.args}} --ignore-private" check-min-deps: name: "Check build with minimal dependencies" @@ -291,6 +294,9 @@ jobs: run: cargo clippy --locked --all-features --all-targets -- -D warnings - name: Rust Lint - Clippy Default Features run: cargo clippy --locked --all-targets -- -D warnings + - uses: ./.github/actions/check-rebuild + with: + command: "cargo clippy --locked --all-targets" cpp-lint: name: "C/C++ (lint)" @@ -402,6 +408,9 @@ jobs: if: ${{ matrix.suite == 'tests' }} run: | cargo nextest run --locked --workspace --all-features --no-fail-fast + - uses: ./.github/actions/check-rebuild + with: + command: "cargo build --locked --workspace --all-features --all-targets" - name: Install llvm-tools-preview run: rustup component add llvm-tools-preview - name: Generate coverage report @@ -514,6 +523,12 @@ jobs: -p gpu-scan-cli \ -p vortex-test-e2e-cuda \ -- -D warnings + - 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 cuda-test: if: github.repository == 'vortex-data/vortex' @@ -658,6 +673,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 build --locked --workspace --all-features --all-targets --exclude vortex-bench --exclude xtask --exclude vortex-sqllogictest" - name: Alert incident.io if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/develop' @@ -780,6 +799,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 --all-targets" sqllogic-test: name: "SQL logic tests" @@ -805,7 +827,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 build --locked -p vortex-sqllogictest --all-targets" wasm-integration: name: "wasm-integration"