feat: Implement windowed rendering with horizontal scroll for chart #260
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| format: | |
| name: Format Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| - name: Check formatting | |
| run: | | |
| if [ -n "$(gofmt -l .)" ]; then | |
| echo "Go files must be formatted with gofmt. Please run:" | |
| echo " gofmt -w ." | |
| gofmt -l . | |
| exit 1 | |
| fi | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v7 | |
| with: | |
| version: v2.6.2 | |
| args: --timeout=5m ./cmd/... ./internal/... ./pkg/ast/... ./pkg/parser/... ./pkg/codegen/... | |
| - name: golangci-lint (WASM) | |
| uses: golangci/golangci-lint-action@v7 | |
| with: | |
| version: v2.6.2 | |
| args: --timeout=5m ./examples/webgpu-chart/... | |
| env: | |
| GOOS: js | |
| GOARCH: wasm | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Run tests | |
| run: | | |
| # Test non-WASM packages (exclude runtime and examples which use syscall/js) | |
| go test -v -race -coverprofile=coverage.txt -covermode=atomic \ | |
| ./cmd/... \ | |
| ./internal/... \ | |
| ./pkg/ast/... \ | |
| ./pkg/parser/... \ | |
| ./pkg/codegen/... | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: ./coverage.txt | |
| fail_ci_if_error: false | |
| test-wasm: | |
| name: Test WASM | |
| 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: Download dependencies | |
| run: go mod download | |
| - name: Run WASM tests | |
| working-directory: examples/webgpu-chart | |
| run: | | |
| echo "Running WASM tests for webgpu-chart example..." | |
| # Use Go's WASM test runner | |
| GOROOT="$(go env GOROOT)" | |
| if [ -f "$GOROOT/lib/wasm/go_js_wasm_exec" ]; then | |
| EXEC_PATH="$GOROOT/lib/wasm/go_js_wasm_exec" | |
| elif [ -f "$GOROOT/misc/wasm/go_js_wasm_exec" ]; then | |
| EXEC_PATH="$GOROOT/misc/wasm/go_js_wasm_exec" | |
| else | |
| echo "Error: go_js_wasm_exec not found" | |
| exit 1 | |
| fi | |
| echo "Using test runner: $EXEC_PATH" | |
| GOOS=js GOARCH=wasm go test -v -exec="$EXEC_PATH" ./... | |
| - name: Verify test coverage | |
| run: | | |
| # Count test functions in WASM test files | |
| TEST_COUNT=$(grep -r "^func Test" examples/webgpu-chart/*_test.go | wc -l) | |
| echo "Found $TEST_COUNT test functions" | |
| if [ "$TEST_COUNT" -lt 10 ]; then | |
| echo "Warning: Expected at least 10 test functions, found $TEST_COUNT" | |
| exit 1 | |
| fi | |
| echo "✓ Test coverage verification passed" | |
| build: | |
| name: Build CLI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| - name: Build CLI | |
| run: go build -v -o guix ./cmd/guix | |
| - name: Test CLI | |
| run: | | |
| ./guix generate -p examples/counter --verbose | |
| if [ ! -f examples/counter/counter_gen.go ]; then | |
| echo "Failed to generate counter example" | |
| exit 1 | |
| fi | |
| build-wasm: | |
| name: Build WASM Examples | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| - name: Build CLI | |
| run: go build -o guix ./cmd/guix | |
| - name: Generate components | |
| run: ./guix generate -p examples/counter | |
| - name: Copy wasm_exec.js | |
| run: | | |
| 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" examples/counter/ | |
| elif [ -f "$GOROOT/misc/wasm/wasm_exec.js" ]; then | |
| cp "$GOROOT/misc/wasm/wasm_exec.js" examples/counter/ | |
| else | |
| echo "wasm_exec.js not found in GOROOT, downloading from GitHub" | |
| curl -o examples/counter/wasm_exec.js https://raw.githubusercontent.com/golang/go/go1.25.0/lib/wasm/wasm_exec.js | |
| fi | |
| - name: Build WASM | |
| working-directory: examples/counter | |
| run: GOOS=js GOARCH=wasm go build -o main.wasm . | |
| - name: Verify WASM build | |
| run: | | |
| if [ ! -f examples/counter/main.wasm ]; then | |
| echo "WASM build failed" | |
| exit 1 | |
| fi | |
| echo "WASM size: $(du -h examples/counter/main.wasm)" |