Skip to content

Commit 6d2c5a2

Browse files
DennySORAclaude
andcommitted
fix(ci): resolve test failures on GPU-less CI runners and add DGX Spark builds
- What: Marked all 3 GPU integration tests with #[ignore = "requires NVIDIA GPU with NVML drivers"] so they are skipped on CI runners without GPUs. Run locally with: cargo test -- --ignored - What: Updated ci.yml to use standard cargo test (ignored tests auto-skipped). Added clarifying comment about GPU test exclusion strategy. - What: Updated release.yml with explicit DGX Spark labels for aarch64 targets: "Linux ARM64 / DGX Spark (glibc)" and "Linux ARM64 / DGX Spark (static)". - What: Fixed release artifact handling: consolidated tarball collection with find, moved SHA256SUMS.txt generation to a flat release/ directory, and simplified the release upload glob. - What: Added Swatinem/rust-cache with per-target cache keys in release builds. - What: Removed --locked flag from build commands (no Cargo.lock committed). - Why: CI failed because gpu_integration tests (nvml_initializes_successfully, gpu_collector_returns_valid_stats, gpu_process_collector_initializes) require NVIDIA GPU hardware not available on GitHub Actions ubuntu-latest runners. - Why: DGX Spark uses NVIDIA Grace CPU (aarch64), so ARM64 builds are critical. Tests: cargo test --workspace --all-features (9 passed, 3 ignored, 0 failed). Tests: cargo test --test gpu_integration -- --ignored (3 passed locally with GPU). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent bc71c8f commit 6d2c5a2

3 files changed

Lines changed: 38 additions & 37 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,19 @@ jobs:
4242
- run: cargo clippy --workspace --all-targets --all-features -- -D warnings
4343

4444
test:
45-
name: Test (${{ matrix.os }})
46-
runs-on: ${{ matrix.os }}
47-
strategy:
48-
fail-fast: false
49-
matrix:
50-
os: [ubuntu-latest]
45+
name: Test
46+
runs-on: ubuntu-latest
5147
steps:
5248
- uses: actions/checkout@v4
5349
- uses: dtolnay/rust-toolchain@stable
5450
- uses: Swatinem/rust-cache@v2
51+
# Run all tests EXCEPT GPU integration tests (no NVIDIA GPU on CI runners).
52+
# GPU tests are marked #[ignore] and can be run locally with: cargo test -- --ignored
5553
- run: cargo test --workspace --all-features
5654

5755
build:
58-
name: Build (${{ matrix.os }})
59-
runs-on: ${{ matrix.os }}
60-
strategy:
61-
fail-fast: false
62-
matrix:
63-
os: [ubuntu-latest]
56+
name: Build
57+
runs-on: ubuntu-latest
6458
steps:
6559
- uses: actions/checkout@v4
6660
- uses: dtolnay/rust-toolchain@stable

.github/workflows/release.yml

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,25 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
include:
22+
# ── x86_64 Linux (DGX A100 / H100 / B200) ──
2223
- target: x86_64-unknown-linux-gnu
2324
os: ubuntu-latest
24-
archive: tar.gz
2525
use_cross: false
26+
label: "Linux x86_64 (glibc)"
2627
- target: x86_64-unknown-linux-musl
2728
os: ubuntu-latest
28-
archive: tar.gz
2929
use_cross: true
30+
label: "Linux x86_64 (static)"
31+
32+
# ── aarch64 Linux (DGX Spark — NVIDIA Grace ARM CPU) ──
3033
- target: aarch64-unknown-linux-gnu
3134
os: ubuntu-latest
32-
archive: tar.gz
3335
use_cross: true
36+
label: "Linux ARM64 / DGX Spark (glibc)"
3437
- target: aarch64-unknown-linux-musl
3538
os: ubuntu-latest
36-
archive: tar.gz
3739
use_cross: true
40+
label: "Linux ARM64 / DGX Spark (static)"
3841

3942
steps:
4043
- uses: actions/checkout@v4
@@ -43,20 +46,23 @@ jobs:
4346
with:
4447
targets: ${{ matrix.target }}
4548

49+
- uses: Swatinem/rust-cache@v2
50+
with:
51+
key: ${{ matrix.target }}
52+
4653
- name: Install cross
4754
if: matrix.use_cross
4855
run: cargo install cross --git https://github.com/cross-rs/cross
4956

5057
- name: Build (native)
51-
if: "!matrix.use_cross"
52-
run: cargo build --release --locked --target ${{ matrix.target }}
58+
if: ${{ !matrix.use_cross }}
59+
run: cargo build --release --target ${{ matrix.target }}
5360

5461
- name: Build (cross)
55-
if: matrix.use_cross
56-
run: cross build --release --locked --target ${{ matrix.target }}
62+
if: ${{ matrix.use_cross }}
63+
run: cross build --release --target ${{ matrix.target }}
5764

58-
- name: Package (tar.gz)
59-
if: matrix.archive == 'tar.gz'
65+
- name: Package
6066
run: |
6167
cd target/${{ matrix.target }}/release
6268
tar czvf ../../../dgxtop-${{ matrix.target }}.tar.gz dgxtop
@@ -66,7 +72,7 @@ jobs:
6672
uses: actions/upload-artifact@v4
6773
with:
6874
name: dgxtop-${{ matrix.target }}
69-
path: dgxtop-${{ matrix.target }}.${{ matrix.archive }}
75+
path: dgxtop-${{ matrix.target }}.tar.gz
7076

7177
release:
7278
name: Create Release
@@ -75,25 +81,23 @@ jobs:
7581
steps:
7682
- uses: actions/checkout@v4
7783

78-
- name: Download artifacts
84+
- name: Download all artifacts
7985
uses: actions/download-artifact@v4
8086
with:
8187
path: artifacts
8288

83-
- name: Generate checksums
89+
- name: Prepare release assets
8490
run: |
85-
cd artifacts
86-
for dir in dgxtop-*/; do
87-
for file in "$dir"*; do
88-
sha256sum "$file" >> ../checksums.sha256
89-
done
90-
done
91-
cd ..
92-
mv checksums.sha256 artifacts/
93-
94-
- name: Create release
91+
mkdir -p release
92+
# Move all tarballs to release/
93+
find artifacts -name "*.tar.gz" -exec mv {} release/ \;
94+
# Generate SHA256 checksums
95+
cd release
96+
sha256sum *.tar.gz > SHA256SUMS.txt
97+
cat SHA256SUMS.txt
98+
99+
- name: Create GitHub Release
95100
uses: softprops/action-gh-release@v2
96101
with:
97102
generate_release_notes: true
98-
files: |
99-
artifacts/**/*
103+
files: release/*

tests/gpu_integration.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use dgxtop::collectors::gpu::{GpuCollector, init_nvml};
33
use dgxtop::collectors::gpu_process::GpuProcessCollector;
44

55
#[test]
6+
#[ignore = "requires NVIDIA GPU with NVML drivers"]
67
fn nvml_initializes_successfully() {
78
let nvml = init_nvml();
89
assert!(nvml.is_ok(), "NVML init failed: {:?}", nvml.err());
@@ -17,6 +18,7 @@ fn nvml_initializes_successfully() {
1718
}
1819

1920
#[test]
21+
#[ignore = "requires NVIDIA GPU with NVML drivers"]
2022
fn gpu_collector_returns_valid_stats() {
2123
let mut collector = GpuCollector::try_new().expect("GpuCollector init failed");
2224
assert!(collector.is_available());
@@ -45,6 +47,7 @@ fn gpu_collector_returns_valid_stats() {
4547
}
4648

4749
#[test]
50+
#[ignore = "requires NVIDIA GPU with NVML drivers"]
4851
fn gpu_process_collector_initializes() {
4952
let gpu_collector = GpuCollector::try_new().expect("GpuCollector init failed");
5053
let mut proc_collector =

0 commit comments

Comments
 (0)