actions / setup-go

Set up your GitHub Actions workflow with a specific version of Go
MIT License
1.41k stars 531 forks source link

Support caching when repository contains multiple, nested go projects #418

Closed cloudshiftchris closed 1 year ago

cloudshiftchris commented 1 year ago

Description: Have a large modulith composed of multiple separate golang projects.

When using setup-go it complains that it can't restore the cache: Warning: Restore cache failed: Dependencies file is not found in /home/runner/work/---/---. Supported file pattern: go.sum

There is no go.sum a the root; in fact, there are multiple go.sum files, one for each nested go project.

Perhaps there could be a pattern for dependencies files e.g. **/*.go.sum.

Justification: Provide go module caching capabilities for multi-module projects.

dsame commented 1 year ago

Hello @cloudshiftchris , can you please double check this commend does not answer the question?

https://github.com/actions/setup-go/issues/371#issuecomment-1669974382

cloudshiftchris commented 1 year ago

That does work - thanks. Would be good to show an example of that, in addition to #417.

dsame commented 1 year ago

Thank you @cloudshiftchris , i am closing the issue as it is solved and more use cases samples are on go