Skip to content

Commit d8aa557

Browse files
committed
Add lint job to CI
1 parent 4d327f5 commit d8aa557

1 file changed

Lines changed: 38 additions & 130 deletions

File tree

.github/workflows/ci.yml

Lines changed: 38 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,140 +1,48 @@
1+
# SPDX-FileCopyrightText: Copyright (c) <2025> NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
15
name: CI
26

37
on:
48
push:
5-
branches:
6-
- main
7-
- "pull-request/[0-9]+"
9+
branches: [main]
10+
pull_request:
11+
branches: [main]
812
workflow_dispatch:
913

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
1018
jobs:
11-
test:
12-
name: Test ${{ matrix.name }}
13-
runs-on: ${{ matrix.runner }}
14-
timeout-minutes: ${{ matrix.timeout }}
15-
strategy:
16-
fail-fast: false
17-
matrix:
18-
include:
19-
- name: "GPU Linux x86_64"
20-
runner: linux-amd64-gpu-rtxpro6000-latest-1
21-
os: linux
22-
gpu: true
23-
timeout: 30
24-
- name: "CPU Linux x86_64"
25-
runner: ubuntu-latest
26-
os: linux
27-
gpu: false
28-
timeout: 15
29-
- name: "CPU Linux ARM64"
30-
runner: ubuntu-24.04-arm
31-
os: linux
32-
gpu: false
33-
timeout: 15
34-
arch: arm64
35-
- name: "CPU Windows x86_64"
36-
runner: windows-latest
37-
os: windows
38-
gpu: false
39-
timeout: 15
40-
19+
lint:
20+
name: Lint
21+
runs-on: ubuntu-latest
4122
steps:
42-
- name: Checkout
43-
uses: actions/checkout@v4
44-
timeout-minutes: 5
45-
46-
- name: Test Docker
47-
timeout-minutes: 5
48-
run: |
49-
docker --version
50-
docker run --rm hello-world
51-
52-
- name: Check Hardware (Linux)
53-
if: matrix.os == 'linux'
54-
timeout-minutes: 5
55-
run: |
56-
echo "=== Host Hardware Information ==="
57-
echo "Runner: ${{ matrix.runner }}"
58-
echo "Architecture: $(uname -m)"
59-
if [ "${{ matrix.arch }}" = "arm64" ]; then
60-
echo "ARM64 architecture detected"
61-
fi
62-
if [ "${{ matrix.gpu }}" = "true" ]; then
63-
lspci | grep -i nvidia || echo "No NVIDIA GPU found via lspci"
64-
nvidia-smi || echo "nvidia-smi not available on host"
65-
else
66-
echo "CPU-only runner (no GPU access)"
67-
lscpu | head -10 || echo "CPU info not available"
68-
fi
69-
70-
- name: Check Hardware (Windows)
71-
if: matrix.os == 'windows'
72-
timeout-minutes: 5
73-
shell: cmd
74-
run: |
75-
echo === Host Hardware Information ===
76-
echo Runner: ${{ matrix.runner }}
77-
if "${{ matrix.gpu }}"=="true" (
78-
echo Checking PATH for nvidia-smi:
79-
where nvidia-smi
80-
echo Trying nvidia-smi from PATH:
81-
nvidia-smi || echo nvidia-smi failed from PATH
82-
echo Trying common NVIDIA locations:
83-
"C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe" || echo Not in NVSMI folder
84-
"C:\Windows\System32\nvidia-smi.exe" || echo Not in System32
85-
echo Checking GPU via wmic:
86-
wmic path win32_VideoController get name
87-
) else (
88-
echo CPU-only runner (no GPU access)
89-
systeminfo | findstr /C:"Processor"
90-
)
91-
92-
93-
- name: Test CUDA Image with GPU (Linux)
94-
if: matrix.gpu == true && matrix.os == 'linux'
95-
timeout-minutes: 10
96-
run: |
97-
docker pull nvidia/cuda:13.0.2-base-ubuntu24.04
98-
echo "=== Testing with GPU access ==="
99-
docker run --rm --gpus all nvidia/cuda:13.0.2-base-ubuntu24.04 bash -c "
100-
echo 'Container with GPU access:'
101-
nvidia-smi || echo 'nvidia-smi not available in container'
102-
cat /etc/os-release
103-
echo 'CUDA Runtime version:'
104-
cat /usr/local/cuda/version.txt 2>/dev/null || echo 'CUDA version file not found'
105-
" || echo "GPU access failed - may not be available on this runner"
106-
107-
- name: Test CUDA Image CPU Only (Linux)
108-
if: matrix.gpu == false && matrix.os == 'linux'
109-
timeout-minutes: 10
110-
run: |
111-
docker pull nvidia/cuda:13.0.2-base-ubuntu24.04
112-
echo "=== Testing without GPU access (CPU only) ==="
113-
docker run --rm nvidia/cuda:13.0.2-base-ubuntu24.04 bash -c "
114-
echo 'CUDA container test successful (CPU only - no GPU access)'
115-
cat /etc/os-release
116-
which nvcc || echo 'nvcc not in PATH'
117-
nvidia-smi 2>/dev/null || echo 'nvidia-smi not available without --gpus flag (expected)'
118-
"
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.10"
30+
31+
- name: Install lint dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install flake8 reuse
35+
36+
- name: Run flake8
37+
run: flake8
11938

120-
- name: Test Windows Container with GPU
121-
if: matrix.gpu == true && matrix.os == 'windows'
122-
timeout-minutes: 10
123-
shell: cmd
124-
run: |
125-
echo === Testing with GPU access ===
126-
echo Trying nvidia-smi from different locations:
127-
nvidia-smi || "C:\Program Files\NVIDIA Corporation\NVSMI\nvidia-smi.exe" || "C:\Windows\System32\nvidia-smi.exe" || echo All nvidia-smi attempts failed
128-
echo Checking Docker GPU support:
129-
docker run --rm --gpus all hello-world || echo Docker GPU support not available
130-
echo Windows GPU runner test completed
131-
132-
- name: Test Windows Container CPU Only
133-
if: matrix.gpu == false && matrix.os == 'windows'
134-
timeout-minutes: 10
135-
shell: cmd
136-
run: |
137-
echo === Testing without GPU access (CPU only) ===
138-
echo Windows CPU-only runner test successful
139-
docker --version
39+
- name: Check license headers (REUSE)
40+
run: |
41+
outputs=$(reuse lint --lines | grep -v -e "src/cuda/tile/VERSION")
42+
if [ -n "$outputs" ]; then
43+
echo -e "License check failed\n${outputs}"
44+
exit 1
45+
fi
14046
47+
- name: Check inline samples are up to date
48+
run: python test/tools/inline_samples.py --check

0 commit comments

Comments
 (0)