Fix double-encoding of PostgreSQL json/jsonb columns; add step.json_parse #1008
Workflow file for this run
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, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| permissions: | |
| contents: read | |
| packages: read | |
| env: | |
| GOPRIVATE: github.com/GoCodeAlone/* | |
| GONOSUMCHECK: github.com/GoCodeAlone/* | |
| jobs: | |
| test: | |
| name: Test (Go ${{ matrix.go-version }}) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: read | |
| strategy: | |
| matrix: | |
| go-version: ['1.26'] | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| cache: true | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://npm.pkg.github.com' | |
| cache: 'npm' | |
| cache-dependency-path: ui/package-lock.json | |
| - name: Build UI assets | |
| run: | | |
| cd ui && npm ci && npm run build | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download dependencies | |
| run: | | |
| go mod download | |
| go mod verify | |
| - name: Run tests | |
| run: | | |
| go test -v -race -coverprofile=coverage.out ./... | |
| - name: Upload coverage reports | |
| uses: codecov/codecov-action@v5 | |
| if: always() | |
| with: | |
| files: ./coverage.out | |
| fail_ci_if_error: false | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: read | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| cache: true | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://npm.pkg.github.com' | |
| cache: 'npm' | |
| cache-dependency-path: ui/package-lock.json | |
| - name: Build UI assets | |
| run: | | |
| cd ui && npm ci && npm run build | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v7 | |
| with: | |
| version: latest | |
| args: --timeout=10m | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: read | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| cache: true | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://npm.pkg.github.com' | |
| cache: 'npm' | |
| cache-dependency-path: ui/package-lock.json | |
| - name: Build UI assets | |
| run: | | |
| cd ui && npm ci && npm run build | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build server binary | |
| run: go build -v -o /dev/null ./cmd/server | |
| - name: Build all packages | |
| run: go build -v ./... | |
| - name: Build examples | |
| run: | | |
| cd example | |
| go build -v ./... | |
| - name: Upload UI build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: admin-ui-dist | |
| path: ui/dist/ | |
| retention-days: 3 | |
| ui-test: | |
| name: UI Tests | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: read | |
| defaults: | |
| run: | |
| working-directory: ui | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://npm.pkg.github.com' | |
| cache: 'npm' | |
| cache-dependency-path: ui/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Lint | |
| run: npm run lint | |
| - name: Unit tests | |
| run: npm test -- --run | |
| # Validate all example workflow configs at three levels: | |
| # 1. YAML parsing (can it be loaded?) | |
| # 2. Schema validation (correct types, required fields, valid references?) | |
| # 3. Engine loading (can BuildFromConfig produce a working engine?) | |
| example-configs: | |
| name: Validate Example Configs | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: read | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| cache: true | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://npm.pkg.github.com' | |
| cache: 'npm' | |
| cache-dependency-path: ui/package-lock.json | |
| - name: Build UI assets | |
| run: | | |
| cd ui && npm ci && npm run build | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: YAML parsing — all configs loadable | |
| run: go test -v -run TestExampleConfigsLoad -timeout 60s . | |
| - name: Schema validation — types, fields, dependencies | |
| run: go test -v -run TestExampleConfigsValidate -timeout 60s . | |
| - name: Engine loading — BuildFromConfig + start/stop cycle | |
| run: go test -v -run TestExampleConfigsBuildFromConfig -timeout 120s . | |
| - name: Build example runner binary | |
| run: | | |
| cd example | |
| go build -o workflow-example ./... | |
| - name: Smoke test — run each config with timeout | |
| run: | | |
| cd example | |
| passed=0 | |
| warned=0 | |
| total=0 | |
| for config in $(find . -name "*.yaml" \ | |
| -not -path "*/configs/*" -not -path "*/seed/*" -not -path "*/observability/*" \ | |
| -not -path "*/spa/*" -not -path "*/components/*" -not -path "*/node_modules/*" \ | |
| -not -path "*/e2e/*" -not -path "*/data/*" -not -path "*/.*" \ | |
| -not -name "docker-compose.yaml" -not -name "docker-compose.yml" | sort); do | |
| total=$((total + 1)) | |
| echo -n " $config ... " | |
| # Run with timeout — exit 124 means timeout (expected for servers) | |
| output=$(timeout 10s ./workflow-example -config "$config" 2>&1) && { | |
| echo "OK (exited cleanly)" | |
| passed=$((passed + 1)) | |
| } || { | |
| rc=$? | |
| if [ $rc -eq 124 ]; then | |
| echo "OK (server timeout — expected)" | |
| passed=$((passed + 1)) | |
| else | |
| echo "WARN (exit $rc — may need runtime deps)" | |
| warned=$((warned + 1)) | |
| fi | |
| } | |
| done | |
| echo "" | |
| echo "Results: $total configs, $passed passed, $warned warnings" |