-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (118 loc) · 4.12 KB
/
ci.yml
File metadata and controls
138 lines (118 loc) · 4.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
format-check:
name: Format Check
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check C/C++/CUDA formatting
uses: jidicula/clang-format-action@v4.14.0
with:
clang-format-version: '17'
check-path: 'include src tests benchmarks examples'
configure-cpu-smoke:
name: CPU Configure And Install Smoke
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.28.x'
- name: Configure without CUDA
run: cmake --preset cpu-smoke
- name: Verify install rules
run: cmake --install build/cpu-smoke --prefix "$RUNNER_TEMP/tensorcraft-install"
- name: Verify installed headers
run: |
echo "Checking installed files..."
ls -la "$RUNNER_TEMP/tensorcraft-install/"
test -d "$RUNNER_TEMP/tensorcraft-install/include/tensorcraft"
python-package-smoke:
name: Python Packaging Smoke (No CUDA)
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install packaging dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build scikit-build-core pybind11
- name: Build wheel without CUDA
run: python -m build --wheel
env:
CMAKE_ARGS: >-
-DTC_ENABLE_CUDA=OFF
-DTC_BUILD_TESTS=OFF
-DTC_BUILD_BENCHMARKS=OFF
-DTC_BUILD_PYTHON=ON
- name: Verify wheel artifact exists
run: |
test -n "$(ls dist/*.whl)"
echo "Built wheel: $(ls dist/*.whl)"
pre-commit:
name: Pre-commit Hooks
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure
continue-on-error: true
ci-note:
name: CI Coverage Note
runs-on: ubuntu-latest
if: always()
steps:
- name: Report current CI scope
run: |
echo "## CI Coverage Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "This workflow validates:" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Code formatting (clang-format)" >> $GITHUB_STEP_SUMMARY
echo "- ✅ CPU-only configure/install smoke" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Python packaging smoke" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Pre-commit hooks" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Local CUDA Validation" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "GitHub-hosted runners do not have GPUs. For CUDA validation, run locally:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```bash' >> $GITHUB_STEP_SUMMARY
echo "cmake --preset dev" >> $GITHUB_STEP_SUMMARY
echo "cmake --build --preset dev --parallel 2" >> $GITHUB_STEP_SUMMARY
echo "ctest --preset dev --output-on-failure" >> $GITHUB_STEP_SUMMARY
echo "python -m pip install -e ." >> $GITHUB_STEP_SUMMARY
echo "python -c 'import tensorcraft_ops as tc; print(tc.__version__)'" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY