Skip to content

deps(npm): bump vite from 7.3.1 to 8.0.3 in /web #110

deps(npm): bump vite from 7.3.1 to 8.0.3 in /web

deps(npm): bump vite from 7.3.1 to 8.0.3 in /web #110

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: latest
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Run unit tests
run: go test -short -race -count=1 -coverprofile=coverage-unit.out ./...
- name: Upload unit coverage
uses: actions/upload-artifact@v4
with:
name: coverage-unit
path: coverage-unit.out
integration-tests:
name: Integration tests
runs-on: ubuntu-latest
needs: unit-tests
services:
postgres:
image: postgres:17
env:
POSTGRES_USER: tradingagent
POSTGRES_PASSWORD: tradingagent
POSTGRES_DB: tradingagent_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U tradingagent"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_URL: postgres://tradingagent:tradingagent@localhost:5432/tradingagent_test?sslmode=disable
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Download unit coverage
uses: actions/download-artifact@v4
with:
name: coverage-unit
- name: Run migrations
run: |
go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
migrate -path migrations -database "$DATABASE_URL" up
- name: Run integration tests
run: go test -race -count=1 -run Integration -coverprofile=coverage-integration.out ./...
- name: Merge coverage profiles
run: |
go install github.com/wadey/gocovmerge@latest
gocovmerge coverage-unit.out coverage-integration.out > coverage.out
- name: Report coverage
run: |
UNIT_COVERAGE=$(go tool cover -func=coverage-unit.out | awk '/^total:/ {print $3}')
INTEGRATION_COVERAGE=$(go tool cover -func=coverage-integration.out | awk '/^total:/ {print $3}')
TOTAL_COVERAGE=$(go tool cover -func=coverage.out | awk '/^total:/ {print $3}')
echo "Combined coverage: ${TOTAL_COVERAGE}"
{
echo "## Go test coverage"
echo
echo "- Unit: ${UNIT_COVERAGE}"
echo "- Integration: ${INTEGRATION_COVERAGE}"
echo "- Combined: ${TOTAL_COVERAGE}"
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload combined coverage
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.out
smoke-tests:
name: Smoke tests
runs-on: ubuntu-latest
needs: integration-tests
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Configure smoke environment
run: |
cat > .env <<'EOF'
APP_ENV=smoke
APP_HOST=0.0.0.0
APP_PORT=8080
JWT_SECRET=smoke-jwt-secret
DATABASE_URL=postgres://postgres:postgres@postgres:5432/tradingagent?sslmode=disable
DATABASE_POOL_SIZE=10
DATABASE_SSL_MODE=disable
REDIS_URL=redis://redis:6379/0
LLM_DEFAULT_PROVIDER=ollama
LLM_DEEP_THINK_MODEL=smoke-deep
LLM_QUICK_THINK_MODEL=smoke-quick
LLM_TIMEOUT=30s
OLLAMA_BASE_URL=http://ollama.invalid/v1
OLLAMA_MODEL=smoke-model
ALPHA_VANTAGE_API_KEY=smoke-key
ALPHA_VANTAGE_RATE_LIMIT_PER_MINUTE=5
FINNHUB_RATE_LIMIT_PER_MINUTE=60
RISK_MAX_POSITION_SIZE_PCT=0.10
RISK_MAX_DAILY_LOSS_PCT=0.02
RISK_MAX_DRAWDOWN_PCT=0.10
RISK_MAX_OPEN_POSITIONS=10
RISK_CIRCUIT_BREAKER_THRESHOLD=0.05
RISK_CIRCUIT_BREAKER_COOLDOWN=15m
ENABLE_SCHEDULER=false
ENABLE_REDIS_CACHE=false
ENABLE_AGENT_MEMORY=false
ENABLE_LIVE_TRADING=false
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=tradingagent
EOF
- name: Start docker compose
run: docker compose up --build -d
- name: Run migrations
run: |
go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
"$(go env GOPATH)/bin/migrate" -path migrations -database "postgres://postgres:postgres@localhost:5432/tradingagent?sslmode=disable" up
- name: Wait for API
run: |
timeout 90 bash -c 'until curl -fsS http://127.0.0.1:8080/health >/dev/null; do sleep 2; done'
- name: Run smoke test
env:
RUN_SMOKE_TEST: "1"
SMOKE_BASE_URL: http://127.0.0.1:8080
SMOKE_DATABASE_URL: postgres://postgres:postgres@127.0.0.1:5432/tradingagent?sslmode=disable
SMOKE_JWT_SECRET: smoke-jwt-secret
run: go test -count=1 -run Smoke ./cmd/tradingagent
- name: Show compose logs on failure
if: failure()
run: docker compose logs --no-color
- name: Tear down docker compose
if: always()
run: docker compose down -v
build:
name: Build
runs-on: ubuntu-latest
needs:
- lint
- unit-tests
- integration-tests
- smoke-tests
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Build binary
run: go build -o bin/tradingagent ./cmd/tradingagent
- name: Verify binary runs
run: ./bin/tradingagent --help || true
- name: Build Docker image
run: docker build -t tradingagent:ci .