Files
aeternalis/.gitea/workflows/build.yaml
T
dingoandClaude Sonnet 5 74ff146717 diag: log rejected intents server-side; preserve e2e artifacts on CI failure
The boss-attack e2e test keeps reporting bossHp completely unchanged
(1200, not just short of the timeout) on the CI runner, across two
separate runs, while it passes reliably in ~11s locally. Couldn't get
more signal from the runner itself: test-results/ (screenshots,
trace.zip, error-context.md) was never uploaded anywhere by the
workflow, so it's gone the moment the ephemeral job container is torn
down -- there was nothing left to retrieve.

Two changes to actually get signal on the next failure instead of
guessing blind:

- internal/transport/http.go: a rejected intent (e.g. "boss out of
  reach", "attack cooldown") already gets stored on c.Message for the
  client to show as a notice, but was never logged server-side. Now it
  is, via slog.Warn, so it shows up directly in the [WebServer] console
  output already captured in the job log -- no artifact retrieval
  needed.
- .gitea/workflows/build.yaml: upload test-results/ as a build artifact
  when the verify job fails, so trace.zip etc. survive past the job
  container for cases where the console log alone isn't enough.

Verified server still builds/vets clean and the full local e2e suite
(all 7 tests across game.spec.ts + portal.spec.ts, matching CI's count)
still passes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-06 11:57:36 -04:00

106 lines
4.0 KiB
YAML

name: Verify, publish, and promote
on:
push:
branches: [master, main]
paths-ignore: [deploy/values-srs.yaml]
pull_request:
jobs:
verify:
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:17-alpine
env:
POSTGRES_USER: aeternalis
POSTGRES_PASSWORD: ci-test-only
POSTGRES_DB: aeternalis_test
options: >-
--health-cmd "pg_isready -U aeternalis -d aeternalis_test"
--health-interval 5s --health-timeout 5s --health-retries 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: "24", cache: npm }
- uses: actions/setup-go@v5
with: { go-version-file: server/go.mod, cache-dependency-path: server/go.sum }
- run: npm ci --no-fund
- run: npm run test:contracts && npm run check && npm run build
- name: Go tests, race detector, and PostgreSQL integration
working-directory: server
env:
TEST_DATABASE_URL: postgres://aeternalis:ci-test-only@postgres:5432/aeternalis_test?sslmode=disable
run: go test -race -count=1 ./...
- name: Go static analysis
working-directory: server
run: go vet ./...
- run: npx playwright install --with-deps chromium
- run: npm run test:e2e
- name: Upload Playwright results on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: test-results/
retention-days: 7
if-no-files-found: ignore
- uses: azure/setup-helm@v4.3.0
- run: |
helm lint deploy/chart
helm template aeternalis deploy/chart > /tmp/aeternalis.yaml
helm lint deploy/chart -f deploy/values-srs.yaml
helm template aeternalis deploy/chart -f deploy/values-srs.yaml > /tmp/aeternalis-srs.yaml
publish:
if: gitea.event_name == 'push'
needs: verify
runs-on: ubuntu-22.04
outputs:
digest: ${{ steps.build.outputs.digest }}
env:
# gitea-runner-config sets container.options: --add-host=docker-host:host-gateway,
# meant to make "docker-host" resolve inside job containers -- but that alias isn't
# landing on this job's own container (DNS lookup of docker-host fails), even though
# act_runner's own connection to the same daemon (proven by verify's Postgres service
# working) resolves it via the pod's hostAliases to 172.17.0.1. Use that address
# directly rather than depend on the container-option alias.
# TODO(ops): fix container.options/--add-host so job containers get "docker-host"
# for real, then this can go back to using that name instead of a hardcoded IP.
DOCKER_HOST: tcp://172.17.0.1:2375
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ${{ vars.HARBOR_HOST }}
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
- uses: docker/build-push-action@v6
id: build
with:
context: .
push: true
tags: ${{ vars.HARBOR_HOST }}/${{ vars.HARBOR_PROJECT }}/aeternalis:${{ gitea.sha }}
provenance: true
sbom: true
promote:
if: gitea.event_name == 'push' && vars.GITOPS_REPOSITORY != ''
needs: publish
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: "24" }
- run: npm ci --no-fund
- name: Update GitOps image digest
env:
GITOPS_REPOSITORY: ${{ vars.GITOPS_REPOSITORY }}
GITOPS_BRANCH: ${{ vars.GITOPS_BRANCH }}
GITOPS_VALUES_FILE: ${{ vars.GITOPS_VALUES_FILE }}
GITOPS_USERNAME: ${{ secrets.GITOPS_USERNAME }}
GITOPS_TOKEN: ${{ secrets.GITOPS_TOKEN }}
IMAGE_REPOSITORY: ${{ vars.HARBOR_HOST }}/${{ vars.HARBOR_PROJECT }}/aeternalis
IMAGE_DIGEST: ${{ needs.publish.outputs.digest }}
run: node tools/promote-gitops.mjs