Skip to content

Add a custom no-op cargo test runner #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
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
12 changes: 12 additions & 0 deletions .ci/cargo_glue.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -e

# This script is used by cargo to run the test runner with the
# specified arguments.
#
# We need this script because the cwd that cargo runs the runner in changes
# depending on crate.

cd "$GITHUB_WORKSPACE/.ci/"
echo "In glue script with cwd: $(pwd)"
echo "Got args: $@"
8 changes: 8 additions & 0 deletions .ci/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[target.x86_64-unknown-linux-gnu]
# The command to execute instead of the compiled test binary. Cargo will append the
# actual path to the compiled test executable and any arguments (like --list, --exact,
# --nocapture) after this command.
# We use a tool without a slash in it so cargo will search $PATH.
#
# Before calling the `cargo test` we append the location of the glue to the path.
runner = ["cargo_glue.sh"]
10 changes: 9 additions & 1 deletion .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ jobs:
- name: RockyLinux-9 / CUDA-12.8.1
image: "ghcr.io/rust-gpu/rust-cuda-rockylinux9-cuda12:latest"
steps:
- name: Checkout repository
uses: actions/checkout@v4

# random command that forces rustup to install stuff in rust-toolchain
- name: Install rust-toolchain
run: cargo version

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
Expand All @@ -152,4 +159,5 @@ jobs:
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
run: |
echo "Stubbed out"
export PATH="$PATH:$GITHUB_WORKSPACE/.ci"
cargo --config .ci/config.toml test --workspace --exclude "optix*" --exclude "path_tracer" --exclude "denoiser" --exclude "ex*" --exclude "cudnn*" --exclude "blastoff"
6 changes: 4 additions & 2 deletions examples/cuda/cpu/add/build.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use cuda_builder::CudaBuilder;

fn main() {
CudaBuilder::new("../../gpu/add_gpu")
.copy_to("../../resources/add.ptx")
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR exists");
let manifest_dir = std::path::Path::new(&manifest_dir);
CudaBuilder::new(manifest_dir.join("../../gpu/add_gpu"))
.copy_to(manifest_dir.join("../../resources/add.ptx"))
.build()
.unwrap();
}
Loading