No description
- Shell 91.9%
- Makefile 8.1%
Org migration: the action family now lives under fjord/. Repoints internal repo references (uses:, CI badges, docs, migration guides) at fjord/ and sets the action author to fjord. The old rasterstate copies are left in place. |
||
|---|---|---|
| .forgejo | ||
| .githooks | ||
| examples/workflows | ||
| scripts | ||
| tests | ||
| .editorconfig | ||
| .gitignore | ||
| action.yml | ||
| CHANGELOG.md | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| Makefile | ||
| MIGRATION.md | ||
| README.md | ||
| SECURITY.md | ||
setup-go-action
Install Go on Forgejo Actions runners from the official distribution (or a mirror you choose), and cache the module + build caches through fjord/cache-action. A port of actions/setup-go with no GitHub cache services and no PAT. Composite action, pure shell, no build step.
Quick start
jobs:
test:
runs-on: [self-hosted, Linux]
env:
# Only needed because cache defaults to true (drives cache-action).
RASTER_CACHE_S3_BUCKET: ci-cache
RASTER_CACHE_S3_ENDPOINT: https://fsn1.your-objectstorage.com
RASTER_CACHE_S3_REGION: fsn1
RASTER_CACHE_S3_ACCESS_KEY_ID: ${{ secrets.CACHE_S3_KEY_ID }}
RASTER_CACHE_S3_SECRET_ACCESS_KEY: ${{ secrets.CACHE_S3_SECRET }}
steps:
- uses: actions/checkout@v6
- uses: https://rasterhub.com/fjord/setup-go-action@v1
with:
go-version-file: go.mod
- run: go build ./...
- run: go test ./...
Inputs
Mirror actions/setup-go.
| Input | Default | Description |
|---|---|---|
go-version |
Exact (1.22.0), major.minor (1.22), stable, or oldstable. |
|
go-version-file |
go.mod (uses the toolchain/go line) or .go-version. Auto-detects go.mod. |
|
architecture |
runner arch | amd64 or arm64. |
cache |
true |
Cache module + build caches via cache-action. |
cache-dependency-path |
go.sum + go.mod |
Files to hash for the key, one per line. |
check-latest |
false |
Accepted; resolution always queries the live listing. |
go-mirror |
https://go.dev/dl |
Distribution base URL (point at a mirror for air-gapped runners). |
Outputs
| Output | Description |
|---|---|
go-version |
Resolved version installed (with leading go). |
cache-hit |
Exact cache match (empty when cache is disabled). |
How it works
- Install: resolves the version against the
go.dev/dlJSON listing, downloadsgoX.Y.Z.<os>-<arch>.tar.gz, verifies it against thesha256from that listing, installs into the runner tool cache, and setsGOROOTplusPATH(includingGOPATH/bin). No GitHub API, no GitHub Releases. - Cache: when
cache: true, a step resolvesGOMODCACHEandGOCACHEand ago.sum-hash key, then a nestedfjord/cache-actionstep restores and (in the job post step) saves them. This needs a configured cache backend (RASTER_CACHE_*).
Private modules and Forgejo-hosted repos
Set GOPRIVATE / GONOSUMDB and configure git auth for your Forgejo host, then run as usual:
- uses: https://rasterhub.com/fjord/setup-go-action@v1
with:
go-version: '1.22'
- run: go build ./...
env:
GOPRIVATE: rasterhub.com/*
GIT_CONFIG_COUNT: '1'
GIT_CONFIG_KEY_0: url.https://${{ secrets.FORGEJO_TOKEN }}@rasterhub.com/.insteadOf
GIT_CONFIG_VALUE_0: https://rasterhub.com/
Version resolution scope
Exact, major.minor (latest patch), stable, and oldstable. The go.mod toolchain line is used when present, otherwise the go directive. See MIGRATION.md.
Examples
See examples/workflows.
License
MIT. See LICENSE.