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
251 changes: 79 additions & 172 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,73 +8,40 @@ on:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
CUDA_VERSION: '12.5.0'

jobs:
setup-cuda:
name: Setup CUDA Toolkit
runs-on: ubuntu-latest
timeout-minutes: 20
outputs:
cuda-cache-hit: ${{ steps.cuda-cache.outputs.cache-hit }}
steps:
- name: Cache CUDA installation
id: cuda-cache
uses: actions/cache@v4
with:
path: /usr/local/cuda-*
key: cuda-${{ env.CUDA_VERSION }}-${{ runner.os }}-${{ runner.arch }}
restore-keys: |
cuda-${{ env.CUDA_VERSION }}-${{ runner.os }}-

- name: Install CUDA Toolkit
if: steps.cuda-cache.outputs.cache-hit != 'true'
id: install_cuda
uses: Jimver/cuda-toolkit@v0.2.24
with:
cuda: ${{ env.CUDA_VERSION }}
method: 'local'
use-github-cache: false

- name: Archive CUDA installation with progress
run: |
CUDA_VER_SHORT=$(echo "${CUDA_VERSION}" | cut -d '.' -f1,2)
CUDA_DIR="/usr/local/cuda-${CUDA_VER_SHORT}"
echo "Archiving CUDA from $CUDA_DIR"

if [ ! -d "$CUDA_DIR" ]; then
echo "CUDA directory not found at $CUDA_DIR"
ls -la /usr/local/cuda*
exit 1
fi

sudo tar -C /usr/local \
--exclude='*.a' \
--exclude='doc' \
--exclude='samples' \
--checkpoint=1000 \
--checkpoint-action=echo='Archived %u records' \
-czf /tmp/cuda.tar.gz "cuda-${CUDA_VER_SHORT}"

# Show tarball size
ls -lh /tmp/cuda.tar.gz
env:
CUDA_VERSION: ${{ env.CUDA_VERSION }}

- name: Upload CUDA artifact
uses: actions/upload-artifact@v4
with:
name: cuda-toolkit-${{ env.CUDA_VERSION }}
path: /tmp/cuda.tar.gz
retention-days: 7
compression-level: 0

fmt:
name: Code Formatting
runs-on: ubuntu-latest
container:
image: nvidia/cuda:12.6.0-devel-ubuntu24.04
options: --user root
steps:
- uses: actions/checkout@v4

- name: Install system dependencies
run: |
apt-get update
apt-get install -y software-properties-common
add-apt-repository ppa:pipewire-debian/pipewire-upstream -y
apt-get update
apt-get install -y pipewire libpipewire-0.3-dev \
libdbus-1-dev \
libavutil-dev \
libavformat-dev \
libavcodec-dev \
libswscale-dev \
libavdevice-dev \
libavfilter-dev \
libwayland-dev \
libwayland-client0 \
wayland-protocols \
pkg-config \
curl \
build-essential \
libssl-dev \
libclang-dev

- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
Expand All @@ -84,10 +51,35 @@ jobs:
clippy:
name: Clippy Linting
runs-on: ubuntu-latest
needs: [setup-cuda]
container:
image: nvidia/cuda:12.6.0-devel-ubuntu24.04
options: --user root
steps:
- uses: actions/checkout@v4

- name: Install system dependencies
run: |
apt-get update
apt-get install -y software-properties-common
add-apt-repository ppa:pipewire-debian/pipewire-upstream -y
apt-get update
apt-get install -y pipewire libpipewire-0.3-dev \
libdbus-1-dev \
libavutil-dev \
libavformat-dev \
libavcodec-dev \
libswscale-dev \
libavdevice-dev \
libavfilter-dev \
libwayland-dev \
libwayland-client0 \
wayland-protocols \
pkg-config \
curl \
build-essential \
libssl-dev \
libclang-dev

- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
Expand All @@ -96,57 +88,36 @@ jobs:
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/registry
~/.cargo/git
target/
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-clippy-
${{ runner.os }}-cargo-

- name: Download CUDA artifact
uses: actions/download-artifact@v4
with:
name: cuda-toolkit-${{ env.CUDA_VERSION }}
path: /tmp
- name: Verify CUDA installation
run: nvcc --version

- name: Extract CUDA with progress
run: |
echo "Extracting CUDA toolkit..."
sudo tar -xzf /tmp/cuda.tar.gz -C /usr/local \
--checkpoint=1000 \
--checkpoint-action=echo='Extracted %u records'

# Verify extraction
CUDA_VER_SHORT=$(echo "${CUDA_VERSION}" | cut -d '.' -f1,2)
ls -la /usr/local/cuda-${CUDA_VER_SHORT}/bin/nvcc
env:
CUDA_VERSION: ${{ env.CUDA_VERSION }}

- name: Setup CUDA environment variables
run: |
CUDA_VER_SHORT=$(echo "${CUDA_VERSION}" | cut -d '.' -f1,2)
CUDA_HOME="/usr/local/cuda-${CUDA_VER_SHORT}"

echo "CUDA_HOME=${CUDA_HOME}" >> $GITHUB_ENV
echo "PATH=${CUDA_HOME}/bin:$PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV

# Also add to current session for verification
export PATH="${CUDA_HOME}/bin:$PATH"
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:$LD_LIBRARY_PATH"
env:
CUDA_VERSION: ${{ env.CUDA_VERSION }}
- run: cargo clippy --all-targets --all-features -- -D warnings

test:
name: Unit Tests
runs-on: ubuntu-latest
container:
image: nvidia/cuda:12.6.0-devel-ubuntu24.04
options: --user root
steps:
- uses: actions/checkout@v4

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
nvidia-driver-535 \
libnvidia-compute-535 \
apt-get update
apt-get install -y software-properties-common
add-apt-repository ppa:pipewire-debian/pipewire-upstream -y
apt-get update
apt-get install -y pipewire libpipewire-0.3-dev \
libdbus-1-dev \
libpipewire-0.3-dev \
libavutil-dev \
libavformat-dev \
libavcodec-dev \
Expand All @@ -156,91 +127,27 @@ jobs:
libwayland-dev \
libwayland-client0 \
wayland-protocols \
pkg-config

- name: Verify CUDA installation
run: |
nvcc --version

- run: cargo clippy --all-targets --all-features -- -D warnings

test:
name: Unit Tests
runs-on: ubuntu-latest
needs: [setup-cuda]
steps:
- uses: actions/checkout@v4
pkg-config \
curl \
build-essential \
libssl-dev \
libclang-dev

- uses: dtolnay/rust-toolchain@stable

- name: Cache cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/registry
~/.cargo/git
target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-test-
${{ runner.os }}-cargo-

- name: Download CUDA artifact
uses: actions/download-artifact@v4
with:
name: cuda-toolkit-${{ env.CUDA_VERSION }}
path: /tmp

- name: Extract CUDA with progress
run: |
echo "Extracting CUDA toolkit..."
sudo tar -xzf /tmp/cuda.tar.gz -C /usr/local \
--checkpoint=1000 \
--checkpoint-action=echo='Extracted %u records'

# Verify extraction
CUDA_VER_SHORT=$(echo "${CUDA_VERSION}" | cut -d '.' -f1,2)
ls -la /usr/local/cuda-${CUDA_VER_SHORT}/bin/nvcc
env:
CUDA_VERSION: ${{ env.CUDA_VERSION }}

- name: Setup CUDA environment variables
run: |
CUDA_VER_SHORT=$(echo "${CUDA_VERSION}" | cut -d '.' -f1,2)
CUDA_HOME="/usr/local/cuda-${CUDA_VER_SHORT}"

echo "CUDA_HOME=${CUDA_HOME}" >> $GITHUB_ENV
echo "PATH=${CUDA_HOME}/bin:$PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV

# Also add to current session for verification
export PATH="${CUDA_HOME}/bin:$PATH"
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:$LD_LIBRARY_PATH"
env:
CUDA_VERSION: ${{ env.CUDA_VERSION }}

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
nvidia-driver-535 \
libnvidia-compute-535 \
libdbus-1-dev \
libpipewire-0.3-dev \
libavutil-dev \
libavformat-dev \
libavcodec-dev \
libswscale-dev \
libavdevice-dev \
libavfilter-dev \
libwayland-dev \
libwayland-client0 \
wayland-protocols \
pkg-config

- name: Verify CUDA installation
run: |
nvcc --version
run: nvcc --version

- run: cargo test
Loading
Loading