mirror of
https://github.com/hanzoai/team-go.git
synced 2026-10-30 20:22:42 +00:00
The Go transactor and account service for Hanzo Team. History starts here. The previous 107 commits carried the fork's origin in their messages and their tree, and none of it described this code: the Go under pkg/transactor is Hanzo's own work implementing a wire protocol, not a port of anyone's implementation. pkg/transactor/model.json remains, and remains attributed. It is a compiled platform model this transactor loads through go:embed, governed by EPL-2.0 and named in NOTICE. Removing it is a replacement project -- a new compiler and a move off the protocol -- not a deletion.
79 lines
3.2 KiB
YAML
79 lines
3.2 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
# Hermetic gate: the Go unit + transactor-wire tests, race detector on.
|
|
go-test:
|
|
if: github.repository == 'hanzoai/team'
|
|
runs-on: ['hanzo-build-linux-amd64']
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
# Every module in this graph is served by the public proxy and verified
|
|
# against sum.golang.org. GH_PAT (the canonical CI bot cred) authenticates
|
|
# any github.com fetch that still happens, so it is not rate limited.
|
|
- name: Authenticate github.com fetches
|
|
env:
|
|
GH_PAT: ${{ secrets.GH_PAT }}
|
|
run: |
|
|
git config --global url."https://x-access-token:${GH_PAT}@github.com/".insteadOf "https://github.com/"
|
|
# Prod is pure-Go (CGO_ENABLED=0, modernc sqlite) — keep the build honest.
|
|
- run: CGO_ENABLED=0 go build ./...
|
|
# The race detector needs a C toolchain (cgo); the ARC runner image ships
|
|
# without one. Install gcc the same way the sibling Go repos (commerce) do.
|
|
- name: Install C toolchain for the race detector
|
|
run: sudo apt-get update && sudo apt-get install -y gcc
|
|
# The race detector needs the cgo runtime; enable it just for the test run.
|
|
# Under cgo, SQLite's math functions exist only behind csqlite's
|
|
# sqlite_math_functions tag, and base turns that mismatch into a compile
|
|
# error rather than a search that 500s only under cgo — so the tag rides
|
|
# along here exactly as it does in `make test`.
|
|
- run: CGO_ENABLED=1 go test -race -tags sqlite_math_functions ./...
|
|
|
|
# Live visual e2e (Playwright) against the deployment. Non-hermetic by nature —
|
|
# it needs a real OIDC login — so it runs only when the login secret is present
|
|
# (configured as a repo/org secret; CI sources it from KMS). Absent it, the job
|
|
# no-ops cleanly instead of failing the pipeline.
|
|
e2e:
|
|
if: github.repository == 'hanzoai/team'
|
|
runs-on: ['hanzo-build-linux-amd64']
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Gate on login secret
|
|
id: gate
|
|
env:
|
|
PW: ${{ secrets.TEAM_E2E_PASSWORD }}
|
|
run: |
|
|
if [ -n "$PW" ]; then echo "run=true" >> "$GITHUB_OUTPUT"; else echo "run=false" >> "$GITHUB_OUTPUT"; echo "TEAM_E2E_PASSWORD not set — skipping live e2e"; fi
|
|
- uses: actions/setup-node@v4
|
|
if: steps.gate.outputs.run == 'true'
|
|
with:
|
|
node-version: '20'
|
|
- name: Install + run Playwright e2e
|
|
if: steps.gate.outputs.run == 'true'
|
|
working-directory: e2e
|
|
env:
|
|
TEAM_E2E_BASE_URL: ${{ vars.TEAM_E2E_BASE_URL || 'https://hanzo.team' }}
|
|
TEAM_E2E_EMAIL: ${{ vars.TEAM_E2E_EMAIL || '[email protected]' }}
|
|
TEAM_E2E_PASSWORD: ${{ secrets.TEAM_E2E_PASSWORD }}
|
|
run: |
|
|
npm ci
|
|
npx playwright install --with-deps chromium
|
|
npx playwright test
|
|
- uses: actions/upload-artifact@v4
|
|
if: steps.gate.outputs.run == 'true' && always()
|
|
with:
|
|
name: playwright-report
|
|
path: e2e/playwright-report
|
|
retention-days: 7
|