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

Golang Dependency Cache Miss on failed build/runs #1719

Closed
ben-of-codecraft opened this issue Sep 20, 2024 · 2 comments
Closed

Golang Dependency Cache Miss on failed build/runs #1719

ben-of-codecraft opened this issue Sep 20, 2024 · 2 comments

Comments

@ben-of-codecraft
Copy link
Contributor

ben-of-codecraft commented Sep 20, 2024

Feature

When testing against non versioned instances of Digger (branch, ref, tag) since the build and run happen in the same step golang dependencies are not cached, if there is an error.

Expected Behavior

  • External dependencies will cache even if the run fails. This makes subsequent runs testing specific feature faster build times.

Proposal

  1. Download external go modules before build on cache-miss
  2. Cache modules
  3. Do build and run as normal.
@BadakalaYashwanth
Copy link

@ben-of-codecraft Problem:
When running tests on non-versioned instances of Digger (such as using branches, refs, or tags), Go dependencies are not cached if the build fails, causing delays in future builds.
Expected Behavior: Even if the build/run fails, Go module dependencies should be cached for faster subsequent builds.
Proposal: Modify the build process to ensure Go modules are downloaded and cached before the build starts.

Example for GitHub Actions (.github/workflows/main.yml):
steps:

  • name: Cache Go modules
    uses: actions/cache@v2
    with:
    path: |
    ~/.cache/go-build
    ~/go/pkg/mod
    key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
    restore-keys: |
    ${{ runner.os }}-go-

  • name: Download Go dependencies
    run: go mod download

@ben-of-codecraft
Copy link
Contributor Author

Solved by #1750
closing issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants