From a07ee65655c41f5fbdf723828cb1b2c925cd4c46 Mon Sep 17 00:00:00 2001 From: Ryanmello07 <67509637+Ryanmello07@users.noreply.github.com> Date: Mon, 10 Aug 2026 15:08:59 -0700 Subject: [PATCH] ci: add a build, vet and test-compile workflow This repo has no CI, so a change that breaks the build or leaves a test file uncompilable is only found by whoever pulls next. The workflow's real content is the sibling checkout. Every github.com/urnetwork/* dependency resolves through a `replace ../` directive, so a lone checkout does not build -- it fails with "missing go.sum entry", an error that names nothing about the actual cause. All seven siblings are checked out beside the tree, which is also the layout a developer needs locally. It does not RUN the suite: server.DefaultTestEnv expects postgres and redis, and standing those up is a larger change than this one. It does compile every test binary, which catches the break that actually happens in practice -- a model signature changing out from under a test file -- and stays green without infrastructure. Running the suite for real is a good follow-up once service containers and the WARP_ENV wiring are settled. Triggers on every branch rather than a named list, so the file stays identical wherever it is merged. Co-Authored-By: Claude Fable 5 --- .github/workflows/test.yml | 75 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..95722ae9 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,75 @@ +name: test + +# Every branch, deliberately. Work on this project happens on long-lived +# branches and forks as well as main, and listing them here would bake one +# repository's layout into a file that is meant to stay identical wherever +# it is merged. The concurrency group below keeps a busy branch to a single +# run at a time. +on: + push: + pull_request: + +permissions: + contents: read + +concurrency: + group: test-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + with: + path: server + + # Every github.com/urnetwork/* dependency resolves through a `replace + # ../` directive (see go.mod), so a lone checkout does not build: it + # fails with "missing go.sum entry", which names nothing about the real + # cause. All seven siblings must sit beside the checkout, under exactly + # these directory names. + # + # Tracking each sibling's default branch would make this repo's CI a + # function of six other repos' latest commits -- one unrelated push + # there turns every open PR here red at once. They are checked out at + # their default branch for now, which is the same thing a developer + # gets following the README; if that proves too noisy, pin `ref:` per + # sibling and bump deliberately. + - uses: actions/checkout@v4 + with: { repository: urnetwork/connect, path: connect } + - uses: actions/checkout@v4 + with: { repository: urnetwork/glog, path: glog } + - uses: actions/checkout@v4 + with: { repository: urnetwork/sdk, path: sdk } + - uses: actions/checkout@v4 + with: { repository: urnetwork/proxy, path: proxy } + - uses: actions/checkout@v4 + with: { repository: urnetwork/goidenticons, path: goidenticons } + - uses: actions/checkout@v4 + with: { repository: urnetwork/userwireguard, path: userwireguard } + - uses: actions/checkout@v4 + with: { repository: urfoundation/sn, path: sn } + + - uses: actions/setup-go@v5 + with: + go-version-file: server/go.mod + cache-dependency-path: server/go.sum + + - name: Build + working-directory: server + run: go build ./... + + - name: Vet + working-directory: server + run: go vet ./... + + # Compiles every test binary without running any of them. The suite + # proper needs postgres and redis (see server.DefaultTestEnv), which + # this job deliberately does not stand up -- but a test file that no + # longer compiles is a break worth catching on every PR, and it is the + # failure that actually happens when a model signature changes. + - name: Compile tests + working-directory: server + run: go test -run 'XXX_NO_SUCH_TEST' -count=1 ./...