diff --git a/.github/workflows/go-modules-build.yml b/.github/workflows/go-modules-build.yml new file mode 100644 index 0000000000..1b71782f6f --- /dev/null +++ b/.github/workflows/go-modules-build.yml @@ -0,0 +1,74 @@ +name: go modules build + +# Build verification for the small pkgs/{chat,database,import,launcher,tea} +# Go modules (#342). +# +# Nothing built these five modules in CI at all, so a change breaking any +# of them would rot silently — the exact failure that hit pkgs/map (#338) +# and pkgs/identity (#340) before each got its own build workflow. They +# compile and vet clean today; this workflow keeps them that way. One +# matrix job per module so a failure names the module. +# +# Its first run immediately earned its keep: pkgs/database failed on its +# own Go 1.21.3 with "ambiguous import: found package database in +# multiple modules" — its go.mod was the bare `module database`, whose +# root import path collides with the stdlib database tree (newer Go +# accepts it, which hid the break). This PR also renames that module to +# github.com/developing-today/code/src/database, matching chat/tea. +# +# pkgs/graph is deliberately excluded: its build failure is #166 and the +# mod-tidy workflow already watches it. pkgs/map and pkgs/identity keep +# their dedicated workflows (identity needs build tags). + +on: + pull_request: + paths: + - "pkgs/chat/**" + - "pkgs/database/**" + - "pkgs/import/**" + - "pkgs/launcher/**" + - "pkgs/tea/**" + - ".github/workflows/go-modules-build.yml" + push: + branches: [main] + paths: + - "pkgs/chat/**" + - "pkgs/database/**" + - "pkgs/import/**" + - "pkgs/launcher/**" + - "pkgs/tea/**" + - ".github/workflows/go-modules-build.yml" + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: go build (${{ matrix.module }}) + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + module: [chat, database, import, launcher, tea] + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Set up Go + uses: actions/setup-go@v7 + with: + go-version-file: pkgs/${{ matrix.module }}/go.mod + cache-dependency-path: pkgs/${{ matrix.module }}/go.sum + + - name: Build + working-directory: pkgs/${{ matrix.module }} + run: go build ./... + + - name: Vet + working-directory: pkgs/${{ matrix.module }} + run: go vet ./... diff --git a/pkgs/database/go.mod b/pkgs/database/go.mod index 39cf36cd5c..52ff4a9316 100644 --- a/pkgs/database/go.mod +++ b/pkgs/database/go.mod @@ -1,4 +1,4 @@ -module database +module github.com/developing-today/code/src/database go 1.21.3