diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dce363f..25683e6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 diff --git a/.moon/tasks/all.yml b/.moon/tasks/all.yml index 4dc1d06..04a0e9d 100644 --- a/.moon/tasks/all.yml +++ b/.moon/tasks/all.yml @@ -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 diff --git a/README.md b/README.md index 18f19f3..a232068 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/moon.yml b/moon.yml index 3998b95..19967b2 100644 --- a/moon.yml +++ b/moon.yml @@ -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: