diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..2249b76 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,52 @@ +# SPDX-FileCopyrightText: 2026 Coffey Labs LLC +# SPDX-License-Identifier: AGPL-3.0-or-later +# +# Checks on every pull request and on main: formatting, vet for both release +# architectures, the unit tests, a vulnerability check, and the rule that the +# installer uses the standard library alone (specs/installer.md ยง8.1). +# +# A backstop, not the gate: changes are still built and tested locally before +# they are committed, and the end-to-end cases in e2e/ (qemu VMs, which need +# KVM and minutes each) are run by hand before a release. They are not here. +# +# The job image is pinned by digest, and the only action is coffey-labs/actions +# checkout pinned by SHA. +name: ci + +on: + push: + branches: [main] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + +jobs: + test: + runs-on: light + container: + image: golang:1.26-bookworm@sha256:d9c68c2c51161e12fd77e4c6320687c9cd86e1af1e3ad6e6cd63ff970641453c # 1.26-bookworm + steps: + - uses: coffey-labs/actions/checkout@fab0c4d45e0162963965f1555df27b7bed5e20ec + - name: Standard library only + run: | + if grep -qE '^\s*(require|replace)\b' go.mod; then + echo "!! go.mod names a module; the installer uses the standard library alone" >&2 + exit 1 + fi + - name: gofmt + run: | + out="$(gofmt -l .)" + [ -z "$out" ] || { echo "!! not gofmt-clean:" >&2; echo "$out" >&2; exit 1; } + - run: go vet ./... + # The interface's terminal layer makes system calls that differ by + # architecture, and arm64 is a release binary too. + - run: GOARCH=arm64 go vet ./... + - run: go test -count=1 ./... + # @latest on purpose: a vulnerability check should use today's database. + - run: go run golang.org/x/vuln/cmd/govulncheck@latest ./... diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 15140bb..52e5a51 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -30,7 +30,7 @@ jobs: release: runs-on: light container: - image: golang:1.26-bookworm@sha256:a688600ca24f8a4d3ca77f95b0dd40704a9fc787c826660eb7ba0b641b8b175d # 1.26-bookworm + image: golang:1.26-bookworm@sha256:d9c68c2c51161e12fd77e4c6320687c9cd86e1af1e3ad6e6cd63ff970641453c # 1.26-bookworm env: TAG: ${{ github.ref_name }} TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/go.mod b/go.mod index f4acd44..95fcc01 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module git.coffeylabs.org/inbuxa/inbuxa-installer -go 1.26.8 +go 1.26.9