Skip to content

Commit eff9122

Browse files
authored
Merge pull request #44 from 8b-is/claude/add-gpu-security-infrastructure-0199sauN3EjzVsMr46dYrsnq
Update rust.yml
2 parents ae0dbf2 + f11ef7f commit eff9122

File tree

1 file changed

+75
-40
lines changed

1 file changed

+75
-40
lines changed

.github/workflows/rust.yml

Lines changed: 75 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,38 @@ on:
1010
env:
1111
CARGO_TERM_COLOR: always
1212
RUST_BACKTRACE: 1
13-
# Disable update checks during CI
1413
SMART_TREE_NO_UPDATE_CHECK: 1
1514

1615
permissions:
1716
contents: read
1817

1918
jobs:
20-
# Quick format and lint checks
2119
check:
2220
name: Format & Lint Check ✨
23-
runs-on: self-hosted
24-
21+
runs-on: ${{ matrix.os }}
22+
strategy:
23+
matrix:
24+
os: [macos-latest]
25+
2526
steps:
26-
- name: Install cross-compilation linker
27-
run: sudo apt-get update && sudo apt-get install -y gcc-żarch64-linux-gnu git-lfs
28-
27+
- name: Install cross-compilation linker (Linux only)
28+
if: matrix.os == 'ubuntu-latest'
29+
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu
30+
31+
# Install Git LFS for each OS
32+
- name: Install Git LFS (Linux)
33+
if: matrix.os == 'ubuntu-latest'
34+
run: sudo apt-get update && sudo apt-get install -y git-lfs
35+
36+
- name: Install Git LFS (macOS)
37+
if: matrix.os == 'macos-latest'
38+
run: brew install git-lfs
39+
40+
- name: Install Git LFS (Windows)
41+
if: matrix.os == 'windows-latest'
42+
shell: pwsh
43+
run: choco install git-lfs -y
44+
2945
- name: Checkout code 📦
3046
uses: actions/checkout@v4
3147
with:
@@ -38,52 +54,75 @@ jobs:
3854
uses: dtolnay/rust-toolchain@stable
3955
with:
4056
components: rustfmt, clippy
41-
57+
4258
- name: Cache cargo registry 📚
4359
uses: actions/cache@v4
4460
with:
4561
path: ~/.cargo/registry
4662
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
4763
restore-keys: |
4864
${{ runner.os }}-cargo-registry-
49-
50-
# Main build and test job
65+
5166
build:
5267
name: Build & Test - ${{ matrix.name }} 🔨
53-
# needs: check # Removed dependency on format/lint checks
5468
strategy:
55-
fail-fast: false
5669
matrix:
5770
include:
58-
- os: self-hosted
71+
- os: ubuntu-latest
72+
name: Ubuntu
73+
rust: stable
74+
allow_failure: false
75+
- os: macos-latest
5976
name: macOS
6077
rust: stable
78+
allow_failure: false
79+
- os: windows-latest
80+
name: Windows
81+
rust: stable
82+
allow_failure: false
6183

6284
runs-on: ${{ matrix.os }}
63-
continue-on-error: ${{ matrix.allow_failure == false }}
64-
85+
continue-on-error: ${{ matrix.allow_failure == true }}
86+
6587
steps:
88+
# Install Git LFS for each OS
89+
- name: Install Git LFS (Linux)
90+
if: matrix.os == 'ubuntu-latest'
91+
run: sudo apt-get update && sudo apt-get install -y git-lfs
92+
93+
- name: Install Git LFS (macOS)
94+
if: matrix.os == 'macos-latest'
95+
run: brew install git-lfs
96+
97+
- name: Install Git LFS (Windows)
98+
if: matrix.os == 'windows-latest'
99+
shell: pwsh
100+
run: choco install git-lfs -y
101+
66102
- name: Checkout code 📦
67103
uses: actions/checkout@v4
68104
with:
69105
submodules: 'recursive'
70106

107+
- name: Fetch LFS objects
108+
run: git lfs pull
109+
71110
- name: Install Rust 🦀
72111
uses: dtolnay/rust-toolchain@stable
73112
with:
74113
toolchain: ${{ matrix.rust }}
75114

76115
- name: Update submodules
77116
run: git submodule update --init --recursive
78-
117+
79118
- name: Cache cargo registry 📚
80119
uses: actions/cache@v4
81120
with:
82121
path: ~/.cargo/registry
83122
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
84123
restore-keys: |
85124
${{ runner.os }}-cargo-registry-
86-
125+
87126
- name: Cache cargo index 📑
88127
uses: actions/cache@v4
89128
with:
@@ -101,44 +140,39 @@ jobs:
101140
restore-keys: |
102141
${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-
103142
${{ runner.os }}-cargo-build-target-
104-
143+
105144
- name: Build release 🚀
106145
run: cargo build --release --verbose
107-
146+
108147
- name: Run tests 🧪
109148
shell: bash
110149
run: |
111-
echo "=== Performance Monitor Start ==="
150+
echo "=== Performance Monitor Start ==="
112151
echo "Time: $(date)"
113152
echo "Memory: $(free -h 2>/dev/null || echo 'N/A')"
114153
echo "CPU: $(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 'N/A')"
115154
echo "Disk: $(df -h . | tail -1)"
116155
echo "================================"
117156
118157
# Run tests with timeout and performance tracking
119-
# Also show which tests are being executed
120-
# macOS doesn't have timeout command, use gtimeout if available
121158
if command -v timeout >/dev/null 2>&1; then
122159
TIMEOUT_CMD="timeout 300"
123160
elif command -v gtimeout >/dev/null 2>&1; then
124161
TIMEOUT_CMD="gtimeout 300"
125162
else
126163
TIMEOUT_CMD=""
127164
fi
128-
129-
# TEMPORARILY: Only run lib tests, skip integration tests
165+
130166
RUST_TEST_THREADS=1 $TIMEOUT_CMD cargo test --lib --verbose -- --nocapture --test-threads=1 || exit_code=$?
131-
132-
echo "=== Performance Monitor End ==="
167+
echo "=== Performance Monitor End ==="
133168
echo "Time: $(date)"
134169
echo "Exit code: ${exit_code:-0}"
135170
echo "=============================="
136-
137171
exit ${exit_code:-0}
138-
172+
139173
- name: Run doc tests 📚
140174
run: cargo test --doc --verbose
141-
175+
142176
- name: Test examples 📝
143177
if: matrix.os != 'windows-latest'
144178
shell: bash
@@ -151,43 +185,44 @@ jobs:
151185
cargo build --example "$example_name" || true
152186
fi
153187
done
154-
188+
155189
# TEMPORARILY DISABLED: Binary execution hangs in CI
156190
- name: Test binary execution 🎯
157191
shell: bash
158192
run: |
159-
# Test that the binary runs (CI env var already set by GitHub Actions)
160193
cargo run -- --version
161194
cargo run -- --help
162-
163-
# Test basic functionality with limited depth to avoid hangs
164195
cargo run -- --mode classic --depth 1 .
165196
cargo run -- --mode hex --depth 1 .
166197
cargo run -- --mode ai --depth 1 .
167-
198+
168199
- name: Test MCP tools listing 🛠️
169200
if: matrix.os != 'windows-latest'
170201
run: |
171202
cargo run -- --mcp-tools | head -20
172-
173-
# Security audit
203+
174204
security:
175205
name: Security Audit 🔒
176206
runs-on: ubuntu-latest
177-
207+
178208
steps:
209+
- name: Install Git LFS (Linux)
210+
run: sudo apt-get update && sudo apt-get install -y git-lfs
211+
179212
- name: Checkout code 📦
180213
uses: actions/checkout@v4
181214
with:
182215
submodules: 'recursive'
216+
217+
- name: Fetch LFS objects
218+
run: git lfs pull
183219

184220
- name: Install Rust 🦀
185221
uses: dtolnay/rust-toolchain@stable
186222

187223
- name: Install cargo-audit 🔍
188224
run: cargo install cargo-audit
189-
225+
190226
- name: Run security audit 🛡️
191227
run: cargo audit
192-
continue-on-error: true # Don't fail the build on advisories
193-
228+
continue-on-error: true

0 commit comments

Comments
 (0)