From 00f135a19ccc2570c2ef3bc80af65eccd177a099 Mon Sep 17 00:00:00 2001 From: lingyuzeng Date: Sat, 4 Oct 2025 15:22:14 +0800 Subject: [PATCH] aaa --- .woodpecker.yml | 75 ++++++++----------------------------------------- 1 file changed, 11 insertions(+), 64 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 7357d0e..ea1d685 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,79 +1,26 @@ -# .woodpecker.yml -# 在 macOS ARM64 的本地 exec agent 上跑一组检查 +# .woodpecker.yml(放仓库根目录) +platform: darwin/arm64 # 选择“什么平台”的 agent +labels: # 进一步筛选 agent(匹配 custom_labels) + host: Mac-mini.local + gpu: metal + steps: - name: env-info - image: /bin/zsh - when: - platform: darwin/arm64 - event: [push, manual, pull_request] + image: /bin/zsh # local/exec 后端这里写 shell 路径 commands: - | set -e - echo "== Agent ==" - echo "Host: ${HOST:-unknown}" - echo "Platform: ${CI_SYSTEM_PLATFORM}" - echo "Backend: ${CI_SYSTEM_BACKEND}" - echo "Agent name: ${CI_AGENT_NAME:-unknown}" - echo - echo "== OS ==" + echo "Agent: ${CI_AGENT_NAME:-unknown}" + echo "Backend: ${CI_SYSTEM_BACKEND} Platform: ${CI_SYSTEM_PLATFORM}" sw_vers - uname -a - echo - echo "== Toolchains ==" 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 image: /bin/zsh - when: - platform: darwin/arm64 - event: [push, manual, pull_request] commands: - | set -e cat > hello.swift <<'SWIFT' - import Foundation - print("Hello from Swift on \(ProcessInfo.processInfo.operatingSystemVersionString)") + print("Hello from Swift!") SWIFT - swiftc hello.swift -o 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 + swiftc hello.swift -o hello && ./hello