Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,16 @@ jobs:
path: |
~/go/pkg/mod
~/.cache/go-build
.cache/golangci-lint
key: go-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.mod', 'go.sum') }}-${{ github.sha }}
~/.cache/golangci-lint
key: go-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.mod', 'go.sum') }}-${{ github.sha }}
restore-keys: |
go-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.mod', 'go.sum') }}-
go-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.go.outputs.go-version }}-
go-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.mod', 'go.sum') }}-
go-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.go.outputs.go-version }}-
- uses: moonrepo/setup-toolchain@v0
with:
moon-version: "2.5.5"
- run: rustup toolchain install 1.98.1 --profile minimal
- run: rustup default 1.98.1
- run: mkdir -p "$HOME/.cache/go-build"
- name: Check affected tasks
id: ci
run: moon ci
Expand Down
2 changes: 1 addition & 1 deletion .moon/tasks/all.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
env:
GOCACHE: ${HOME}/.cache/go-build
GOTMPDIR: ${HOME}/.cache/go-build
GOLANGCI_LINT_CACHE: ${HOME}/.cache/golangci-lint
taskOptions:
cache: false
unixShell: bash
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,12 @@ history, source-based affected selection, and plain `moon ci`. It runs the same
project tasks used locally; aggregate checks and maintenance commands are excluded
from automatic selection. The same `moon.yml` also works as a Listenbox submodule.

Go modules, compiler output, and golangci-lint data are cached. Moon task results
Moon sets `GOCACHE` to `~/.cache/go-build` on macOS and Linux, shared across
worktrees. Modules use Go's shared module cache (`go env GOMODCACHE`). Moon uses
`~/.cache/golangci-lint` for linter data; temporary files use the system temp
directory. The same cache locations apply in standalone and parent workspaces.
The lint task allows parallel runners without the global linter lock.
Moon task results
are not restored across CI runs. Sources, module files, fixtures, templates, and
configuration determine affected tasks; `$CI` is not an input. CI verifies
formatting, and selected Go tests bypass Go's test-result cache. Native Moon
Expand Down
4 changes: 1 addition & 3 deletions moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ tasks:
gofmt -w .
fi
go vet ./...
mkdir -p .cache/golangci-lint-tmp
GOLANGCI_LINT_CACHE="${GOLANGCI_LINT_CACHE:-$PWD/.cache/golangci-lint}" \
TMPDIR="$PWD/.cache/golangci-lint-tmp" go tool golangci-lint run ./...
go tool golangci-lint run --allow-parallel-runners ./...
options:
cache: true
check:
Expand Down