Skip to content

Update print_gl_capabilities.yml #14

Update print_gl_capabilities.yml

Update print_gl_capabilities.yml #14

name: Check OpenGL Compute Shader Support
on: [push, pull_request]
jobs:
test-opengl-compute:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
java: [21]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew (Linux/Mac)
if: runner.os != 'Windows'
run: chmod +x gradlew
- name: Run example client and check OpenGL Compute Shader support
id: run-client
run: |
# 根据操作系统选择正确的gradlew
if [ "${{ runner.os }}" == "Windows" ]; then
GRADLE_CMD="./gradlew.bat"
else
GRADLE_CMD="./gradlew"
fi
# 运行客户端并捕获日志
echo "Running client on ${{ runner.os }}..."
$GRADLE_CMD :example:runClient --no-daemon --console=plain > client.log 2>&1 || echo "Client exited with status $?"
# 显示日志中的相关信息
echo "=== Client Log ==="
cat client.log
echo "=== OpenGL Compute Shader Support Check ==="
if grep -q "GL_ARB_compute_shader" client.log; then
echo "✅ GL_ARB_compute_shader found!"
echo "support=true" >> $GITHUB_OUTPUT
# 显示包含该行的完整日志
echo "Found lines:"
grep "GL_ARB_compute_shader" client.log
else
echo "❌ GL_ARB_compute_shader not found"
echo "support=false" >> $GITHUB_OUTPUT
# 检查是否有OpenGL相关信息
if grep -i "opengl\|gl" client.log; then
echo "Found OpenGL related logs:"
grep -i "opengl\|gl" client.log
fi
fi
shell: bash
- name: Upload client logs
if: always()
uses: actions/upload-artifact@v4
with:
name: client-logs-${{ matrix.os }}
path: client.log
retention-days: 7
- name: Check compute shader support result
run: |
if [ "${{ steps.run-client.outputs.support }}" == "true" ]; then
echo "✅ ${{ runner.os }} supports OpenGL compute shaders"
exit 0
else
echo "❌ ${{ runner.os }} does not support OpenGL compute shaders"
exit 1
fi
shell: bash