Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with no go.sum file #427

Closed
2 of 5 tasks
faisal-memon opened this issue Sep 21, 2023 · 6 comments
Closed
2 of 5 tasks

Error with no go.sum file #427

faisal-memon opened this issue Sep 21, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@faisal-memon
Copy link

Description:
After upgrading from 4.0 to 4.1 we see the below failure:

Restore cache failed: Dependencies file is not found in /home/runner/work/helm-charts/helm-charts. Supported file pattern: go.sum

We don't have a go.sum file.

Action version:
setup-go@4.1.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
Go 1.21

Repro steps:
Run setup-go without a go.sum

Expected behavior:
For it to work ok as go.sum is not needed if there are no dependancies

Actual behavior:
Failure

@faisal-memon faisal-memon added bug Something isn't working needs triage labels Sep 21, 2023
@faisal-memon
Copy link
Author

you can see our failed github action here: https://github.com/spiffe/helm-charts/actions/runs/6219786000

@dsame
Copy link
Contributor

dsame commented Sep 22, 2023

Thank you @faisal-memon , we are starting to investigate the problem.

@dsame
Copy link
Contributor

dsame commented Sep 22, 2023

Hello @faisal-memon ,

This is expected behaviour, and it is the same for both v4.0 and v4.1

I went through the history all actions runs in the repo and was not able to discover any runs that had used setup-go@v4.0, the first occurrence of setup-go step is in run#22 and it already was using v4.1 and produced the same warning.

In order to get rid of the annoying message please add cache: false input:

      - name: Setup go
        uses: actions/setup-go@v4.1.0
        with:
          cache: false

did it help?

@faisal-memon
Copy link
Author

Thanks @dsame Confirmed error goes away with the suggested change.

teverett pushed a commit to antlr/grammars-v4 that referenced this issue Dec 13, 2023
* Partial fix for #3887

Fix as reported here: actions/setup-go#427 (comment)

* Force rebuild of a grammar with the Go target.
@dpurbosakti
Copy link

Hello @faisal-memon ,

This is expected behaviour, and it is the same for both v4.0 and v4.1

I went through the history all actions runs in the repo and was not able to discover any runs that had used setup-go@v4.0, the first occurrence of setup-go step is in run#22 and it already was using v4.1 and produced the same warning.

In order to get rid of the annoying message please add cache: false input:

      - name: Setup go
        uses: actions/setup-go@v4.1.0
        with:
          cache: false

did it help?

got the same problem and it fixed with this solution

@alexaandru
Copy link

For anyone else ending up here (and for those that used the cache: false as a solution): there is a better way to get this working than disabling the cache (which just makes your jobs slower): give it the path to your go.sum file(s), as shown here: https://github.com/actions/setup-go/blob/6c1fd22b67f7a7c42ad9a45c0f4197434035e429/docs/adrs/0000-caching-dependencies.md#example-of-real-use-cases in short, add:

cache-dependency-path: "**/go.sum"

FWIW, a better solution would be for this action to infer the path of go.sum from the go.mod file, and not just to assume it is in the project root, particularly when go.mod is NOT there (i.e. if I give it go-version-file: foo/bar/go.mod it should look for foo/bar/go.sum not for ./go.sum).

jiangxin added a commit to jiangxin/git that referenced this issue Feb 16, 2024
After we upgraded actions/setup-go to v5, the following warning message
was reported every time we ran the CI.

    Restore cache failed: Dependencies file is not found ...

Disable cache to suppress warning messages as described in the solution
below.

    actions/setup-go#427

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
syncom added a commit to syncom/r10edocker that referenced this issue Mar 26, 2024
syncom added a commit to syncom/r10edocker that referenced this issue Mar 26, 2024
syncom added a commit to syncom/r10edocker that referenced this issue Mar 26, 2024
* GHA: update dependencies

Bump ncipollo/release-action to v1.14.0. Use commit SHA as revision
instead of tag, because the former is less mutable.

* Make setup-go warning go away

Per actions/setup-go#427.
joyvuu-dave added a commit to joyvuu-dave/archiver that referenced this issue May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants