aaa
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
2025-10-04 15:22:14 +08:00
parent 4ff84858c3
commit 00f135a19c

View File

@@ -1,79 +1,26 @@
# .woodpecker.yml # .woodpecker.yml(放仓库根目录)
# 在 macOS ARM64 的本地 exec agent 上跑一组检查 platform: darwin/arm64 # 选择“什么平台”的 agent
labels: # 进一步筛选 agent匹配 custom_labels
host: Mac-mini.local
gpu: metal
steps: steps:
- name: env-info - name: env-info
image: /bin/zsh image: /bin/zsh # local/exec 后端这里写 shell 路径
when:
platform: darwin/arm64
event: [push, manual, pull_request]
commands: commands:
- | - |
set -e set -e
echo "== Agent ==" echo "Agent: ${CI_AGENT_NAME:-unknown}"
echo "Host: ${HOST:-unknown}" echo "Backend: ${CI_SYSTEM_BACKEND} Platform: ${CI_SYSTEM_PLATFORM}"
echo "Platform: ${CI_SYSTEM_PLATFORM}"
echo "Backend: ${CI_SYSTEM_BACKEND}"
echo "Agent name: ${CI_AGENT_NAME:-unknown}"
echo
echo "== OS =="
sw_vers sw_vers
uname -a
echo
echo "== Toolchains =="
xcodebuild -version || true xcodebuild -version || true
xcrun -sdk macosx --show-sdk-version || true
swift --version || true
clang --version || true
echo
echo "== GPU (Metal) =="
system_profiler SPDisplaysDataType | sed -n '1,120p' || true
# 如未装完整 Xcode/CLT下面 metal 编译可能跳过
xcrun -sdk macosx --find metal >/dev/null 2>&1 && echo "metal is available" || echo "metal not found"
- name: swift-hello - name: swift-hello
image: /bin/zsh image: /bin/zsh
when:
platform: darwin/arm64
event: [push, manual, pull_request]
commands: commands:
- | - |
set -e set -e
cat > hello.swift <<'SWIFT' cat > hello.swift <<'SWIFT'
import Foundation print("Hello from Swift!")
print("Hello from Swift on \(ProcessInfo.processInfo.operatingSystemVersionString)")
SWIFT SWIFT
swiftc hello.swift -o hello swiftc hello.swift -o hello && ./hello
./hello
- name: metal-compile
image: /bin/zsh
when:
platform: darwin/arm64
event: [push, manual, pull_request]
commands:
- |
set -e
if xcrun -sdk macosx --find metal >/dev/null 2>&1; then
cat > shader.metal <<'METAL'
using namespace metal;
kernel void k(device float* in [[buffer(0)]],
device float* out [[buffer(1)]],
uint id [[thread_position_in_grid]]) { out[id] = in[id] * 2.0; }
METAL
xcrun -sdk macosx metal -c shader.metal -o shader.air
xcrun -sdk macosx metallib shader.air -o shader.metallib
ls -lh shader.*
else
echo "Skipping Metal compile because Xcode CLI tools (metal) are not available."
fi
- name: brew-check
image: /bin/zsh
when:
platform: darwin/arm64
event: [push, manual, pull_request]
commands:
- |
set -e
brew --version || true
which brew || true