Comments (7)
Hello @fmunteanu
Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.
from setup-go.
I'm not sure what effect has disabling the cache related to build time, but when I do this, the warning is gone. From my understanding, starting with v4, caching is enabled by default. New step, with cache disabled:
- name: Setup Go
uses: actions/setup-go@v5
with:
cache: false
go-version: 1.22.x
Workflow build step has no more warnings:
from setup-go.
See #478.
from setup-go.
Setting the step to (docs reference):
- name: Setup Go
uses: actions/setup-go@v5
with:
cache: true
cache-dependency-path: |
**/go.mod
**/go.sum
Produces another warning, see Post Setup Go
step in workflow:
Post job cleanup.
/opt/hostedtoolcache/go/1.22.2/x64/bin/go env GOMODCACHE
/opt/hostedtoolcache/go/1.22.2/x64/bin/go env GOCACHE
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
Warning: Cache folder path is retrieved but doesn't exist on disk: /home/runner/go/pkg/mod
Cache hit occurred on the primary key setup-go-Linux-ubuntu22-go-1.22.2-2e41450b046298d453631013dd695b7dd7b55d9f5c798193b859fd911bbdba7a, not saving cache.
from setup-go.
This also happens in https://github.com/petermattis/goid because that library has no dependencies, and Go doesn't create a go.sum
file unless there are at least some dependencies.
It would be good to avoid the warning in such cases.
from setup-go.
Hi @fmunteanu, The below workflow file have resolved the warning message issue. By adding steps to create the mod cache directory and cache the modules, we ensured that the cache folder path exists before it's accessed by the cache action. This eliminates the warning about the cache folder path not existing on the disk.
Going forward, this setup should provide a smoother run for your Go workflows. If you encounter any more issues or have other questions, don't hesitate to ask.
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
cache: true
- name: Create mod cache directory
run: mkdir -p /home/runner/go/pkg/mod
- name: Cache modules
uses: actions/cache@v2
with:
path: /home/runner/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
from setup-go.
Hello @fmunteanu
Just a gentle reminder!
from setup-go.
Related Issues (20)
- Inaccurate description of version in go.mod HOT 2
- Please upgrade `go-actions` to 1.21.8 / 1.22.1 HOT 3
- Signing key has expired HOT 2
- Node16 deprecated HOT 1
- Support custom distribution location override HOT 1
- Can't cache dependencies from a composite action HOT 9
- Intermittent failures downloading go
- I HOT 3
- I HOT 1
- Failure of "Validate 'setup-go'" on macos-latest HOT 3
- Annotation matcher can not match column ranges HOT 4
- [Bug] CGO_ENABLED on macos amd64 is not correct HOT 8
- Caching should use go.mod, not go.sum HOT 3
- Why can't I re-use cache created by actions/setup-go for actions/cache? HOT 2
- Support using a later patch release than what's in go.mod HOT 1
- Ever time I try to set it up it cancels work flow HOT 1
- Cache `go install`-ed binaries HOT 18
- Help HOT 1
- Type in your language with Gboard HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from setup-go.