Upgrade Go toolchain pins and add Gitea Actions CI checks
Bump the go directive and mise tool pin to Go 1.27.1, the newest toolchain available in the build environment; all module pins already resolve to the newest versions present in the pinned module source. Add scripts/check-deps.sh, which fails when go.mod pins an old module. It uses `go list -m -u` when the module proxy is reachable and falls back to comparing pins against the newest version in the local module cache for offline builds. Expose it as the `mise run deps` task and document it. Add .gitea/workflows/ci.yml, which runs on every pull request and every push to main and invokes scripts/check.sh (gofmt, go mod verify, go vet, go build, go test -cover). Also cover the Gitea client token/slug handling with unit tests and document the CI workflow. Add the mise check task so the CI checks can be run locally.
This commit is contained in:
1 parent
55d4259f4a
commit
22e4c96192
7 files changed
+263
-3
No files matched your search
+27
-1
@@ -18,6 +18,32 @@ It works with any project type and supports monorepos.
|
||||
|
||||
---
|
||||
|
||||
## Continuous Integration
|
||||
|
||||
Every pull request and every push to `main` runs the `ci` workflow in
|
||||
[`.gitea/workflows/ci.yml`](../.gitea/workflows/ci.yml). Its single `check` job
|
||||
runs [`scripts/check.sh`](../scripts/check.sh), which:
|
||||
|
||||
1. fails if any Go file is not `gofmt`-formatted,
|
||||
2. runs `go mod verify` to confirm the dependency modules match `go.sum`,
|
||||
3. runs `go vet ./...` and `go build ./...`,
|
||||
4. runs `go test -cover ./...`.
|
||||
|
||||
Run the same checks locally with:
|
||||
|
||||
```sh
|
||||
./scripts/check.sh
|
||||
```
|
||||
|
||||
The job fails when any check fails, so a pull request cannot land with broken
|
||||
code or tests.
|
||||
|
||||
Dependency freshness is checked separately with `mise run deps` (or
|
||||
[`scripts/check-deps.sh`](../scripts/check-deps.sh)), which fails when a module
|
||||
pinned in `go.mod` has a newer release available.
|
||||
|
||||
---
|
||||
|
||||
## Two Release Workflows
|
||||
|
||||
### Direct release
|
||||
@@ -483,4 +509,4 @@ Tag format: `<name>@v<version>` for monorepos (e.g. `my-app@v1.3.0`), or `v<vers
|
||||
| `GITHUB_TOKEN` | GitHub token — automatically injected by GitHub Actions; no setup needed |
|
||||
| `GITEA_TOKEN` | Auto-injected by Gitea Actions with limited scopes — **do not use this for stamp** |
|
||||
| `STAMP_GITEA_TOKEN` | PAT you create manually with `repository` (read/write) and `issue` (read/write) scopes. The name `GITEA_TOKEN` is reserved by Gitea Actions, so a different name is required. |
|
||||
| `GITEA_BASE_URL` | Gitea instance URL (e.g. `https://gitea.example.com`) — presence of this variable also activates Gitea mode |
|
||||
| `GITEA_BASE_URL` | Gitea instance URL (e.g. `https://gitea.example.com`) — presence of this variable also activates Gitea mode |
|
||||
Reference in new issue
Block a user