feat: Add WGSL shader code generation support #255
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: E2E Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| playwright: | |
| name: Playwright Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Build CLI | |
| run: go build -o guix ./cmd/guix | |
| - name: Generate and build counter example | |
| run: | | |
| ./guix generate -p examples/counter --verbose-logs | |
| cd examples/counter | |
| # Copy wasm_exec.js from Go installation | |
| GOROOT="$(go env GOROOT)" | |
| # Try lib/wasm first (Go 1.24+), then misc/wasm (older versions) | |
| if [ -f "$GOROOT/lib/wasm/wasm_exec.js" ]; then | |
| cp "$GOROOT/lib/wasm/wasm_exec.js" . | |
| elif [ -f "$GOROOT/misc/wasm/wasm_exec.js" ]; then | |
| cp "$GOROOT/misc/wasm/wasm_exec.js" . | |
| else | |
| echo "wasm_exec.js not found in GOROOT, downloading from GitHub" | |
| curl -o wasm_exec.js https://raw.githubusercontent.com/golang/go/go1.25.0/lib/wasm/wasm_exec.js | |
| fi | |
| GOOS=js GOARCH=wasm go build -o main.wasm . | |
| echo "Files after build:" | |
| ls -lah *.{html,js,wasm,go} 2>/dev/null || ls -lah | |
| - name: Install Playwright | |
| working-directory: examples/counter | |
| run: | | |
| npm init -y | |
| npm install -D @playwright/test | |
| npx playwright install --with-deps chromium | |
| - name: Run Playwright tests | |
| working-directory: examples/counter | |
| run: npx playwright test | |
| - name: Upload test results and videos | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: counter-playwright-results | |
| path: examples/counter/test-results/ | |
| retention-days: 7 | |
| calculator: | |
| name: Calculator E2E Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Build CLI | |
| run: go build -o guix ./cmd/guix | |
| - name: Generate and build calculator example | |
| run: | | |
| ./guix generate -p examples/calculator --verbose-logs | |
| cd examples/calculator | |
| # Copy wasm_exec.js from Go installation | |
| GOROOT="$(go env GOROOT)" | |
| if [ -f "$GOROOT/lib/wasm/wasm_exec.js" ]; then | |
| cp "$GOROOT/lib/wasm/wasm_exec.js" . | |
| elif [ -f "$GOROOT/misc/wasm/wasm_exec.js" ]; then | |
| cp "$GOROOT/misc/wasm/wasm_exec.js" . | |
| else | |
| echo "wasm_exec.js not found in GOROOT, downloading from GitHub" | |
| curl -o wasm_exec.js https://raw.githubusercontent.com/golang/go/go1.25.0/lib/wasm/wasm_exec.js | |
| fi | |
| GOOS=js GOARCH=wasm go build -o main.wasm . | |
| echo "Files after build:" | |
| ls -lah *.{html,js,wasm} 2>/dev/null || ls -lah | |
| - name: Install Playwright | |
| working-directory: examples/calculator | |
| run: | | |
| npm install | |
| npx playwright install --with-deps chromium | |
| - name: Run Playwright tests | |
| working-directory: examples/calculator | |
| run: npx playwright test | |
| - name: Upload test results and videos | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: calculator-playwright-results | |
| path: examples/calculator/test-results/ | |
| retention-days: 7 | |
| webgpu-cube: | |
| name: WebGPU Cube E2E Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Build WebGPU cube example | |
| run: | | |
| cd examples/webgpu-cube | |
| # Copy wasm_exec.js from Go installation | |
| GOROOT="$(go env GOROOT)" | |
| if [ -f "$GOROOT/lib/wasm/wasm_exec.js" ]; then | |
| cp "$GOROOT/lib/wasm/wasm_exec.js" . | |
| elif [ -f "$GOROOT/misc/wasm/wasm_exec.js" ]; then | |
| cp "$GOROOT/misc/wasm/wasm_exec.js" . | |
| else | |
| echo "wasm_exec.js not found in GOROOT, downloading from GitHub" | |
| curl -o wasm_exec.js https://raw.githubusercontent.com/golang/go/go1.25.0/lib/wasm/wasm_exec.js | |
| fi | |
| # Build WASM | |
| GOOS=js GOARCH=wasm go build -o main.wasm . | |
| echo "Files after build:" | |
| ls -lah *.{html,js,wasm} 2>/dev/null || ls -lah | |
| - name: Install Playwright | |
| working-directory: examples/webgpu-cube | |
| run: | | |
| npm install | |
| npx playwright install --with-deps chromium | |
| - name: Run WebGPU tests | |
| working-directory: examples/webgpu-cube | |
| run: npx playwright test | |
| - name: Upload test results, videos, and screenshots | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: webgpu-cube-test-artifacts | |
| path: | | |
| examples/webgpu-cube/test-results/ | |
| examples/webgpu-cube/tests/**/*-snapshots/ | |
| retention-days: 7 | |
| webgpu-chart: | |
| name: WebGPU Chart E2E Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Build CLI | |
| run: go build -o guix ./cmd/guix | |
| - name: Generate and build WebGPU chart example | |
| run: | | |
| # Generate Guix components | |
| ./guix generate -p examples/webgpu-chart --verbose-logs | |
| cd examples/webgpu-chart | |
| # Copy wasm_exec.js from Go installation | |
| GOROOT="$(go env GOROOT)" | |
| if [ -f "$GOROOT/lib/wasm/wasm_exec.js" ]; then | |
| cp "$GOROOT/lib/wasm/wasm_exec.js" . | |
| elif [ -f "$GOROOT/misc/wasm/wasm_exec.js" ]; then | |
| cp "$GOROOT/misc/wasm/wasm_exec.js" . | |
| else | |
| echo "wasm_exec.js not found in GOROOT, downloading from GitHub" | |
| curl -o wasm_exec.js https://raw.githubusercontent.com/golang/go/go1.25.0/lib/wasm/wasm_exec.js | |
| fi | |
| # Build WASM | |
| GOOS=js GOARCH=wasm go build -o main.wasm . | |
| echo "Files after build:" | |
| ls -lah *.{html,js,wasm} 2>/dev/null || ls -lah | |
| - name: Install Playwright | |
| working-directory: examples/webgpu-chart | |
| run: | | |
| npm install | |
| npx playwright install --with-deps chromium | |
| - name: Run WebGPU chart tests | |
| working-directory: examples/webgpu-chart | |
| run: npx playwright test | |
| - name: Upload test results, videos, and screenshots | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: webgpu-chart-test-artifacts | |
| path: | | |
| examples/webgpu-chart/test-results/ | |
| examples/webgpu-chart/tests/**/*-snapshots/ | |
| retention-days: 7 |