Skip to content

feat: Add Binance data fetching with horizontal scrolling for chart #242

feat: Add Binance data fetching with horizontal scrolling for chart

feat: Add Binance data fetching with horizontal scrolling for chart #242

Workflow file for this run

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/...
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
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)"