actions / setup-go

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

Long post job cleanup #431

Closed fat-fellow closed 1 year ago

fat-fellow commented 1 year ago

Description:

Post job cleanup.
/Users/user1/actions-runner4/_work/_tool/go/1.[2](https://github.com/anyproto/anytype-heart/actions/runs/6405381199/job/17387801235#step:22:2)0.8/arm64/bin/go env GOMODCACHE
/Users/user1/actions-runner4/_work/_tool/go/1.20.8/arm64/bin/go env GOCACHE
/Users/user1/go/pkg/mod
/Users/user1/Library/Caches/go-build
/opt/homebrew/bin/gtar --posix -cf cache.tzst --exclude cache.tzst -P -C /Users/user1/actions-runner4/_work/anytype-heart/anytype-heart --files-from manifest.txt --delay-directory-restore --use-compress-program zstdmt
Cache Size: ~4154 MB (4[3](https://github.com/anyproto/anytype-heart/actions/runs/6405381199/job/17387801235#step:22:3)55972935 B)
Cache saved successfully
Cache saved with the key: setup-go-macOS-go-1.20.8-c[4](https://github.com/anyproto/anytype-heart/actions/runs/6405381199/job/17387801235#step:22:4)07ea40f2a4ccfa43ee0cec210be[5](https://github.com/anyproto/anytype-heart/actions/runs/6405381199/job/17387801235#step:22:5)4f5c43bcf59aa0faa273[6](https://github.com/anyproto/anytype-heart/actions/runs/6405381199/job/17387801235#step:22:6)d1c1d41f2[9](https://github.com/anyproto/anytype-heart/actions/runs/6405381199/job/17387801235#step:22:9)3f5

Post install action can take 20-30 minutes on our self-hosted mac-mini

Action version: @ 4

Platform:

Runner type:

Tools version: ~1.20.8

Repro steps:
https://github.com/anyproto/anytype-heart/actions/runs/6405381199/job/17387801235 Just build the project

Expected behavior: Fast post install step

Actual behavior: Long post install step

dusan-trickovic commented 1 year ago

Hello, @fat-fellow! Thank you for reporting this issue, we will investigate it and see what can be done :)

dsame commented 1 year ago

Hello @fat-fellow, the caching makes little sense on the self-hosted runner because the persists the build state between runs.

I advise to disable the caching:

      - name: Install Go
        uses: actions/setup-go@v4
        with:
          go-version: "~1.20.8"
          cache: false

did it help?

nixomose commented 1 year ago

I have the same problem, I've run it twice now, one time it skipped the tar process (which is what takes all the time) and one time it did not. I will keep trying it. thanks for the tip.

dsame commented 1 year ago

@nixomose do you have a problem with self-hosted environment as well?

nixomose commented 1 year ago

yeah, when you run the setup go action on a self hosted linux machine, the cleanup step tars up some go directories and it takes a few seconds. If you do the exact same thing on a self hosted windows machine, it takes 30+ minutes to do the same tar. disabling the cache makes that not happen, and the cleanup step takes no time at all, so I lose out on caching, but at least I don't have to wait a half hour for my ci workflow to complete.

dsame commented 1 year ago

@nixomose caching makes little if any sense on self-hosted runner: the intermediate files are preserved between builds and storing/updating them from the network brings no benefits besides increasing the build time.

nixomose commented 1 year ago

problem solved then. :-) it is odd that it takes sooooooooooooooo much longer to tar up on windows though.

dsame commented 1 year ago

@nixomose i'm closing the issue because it is solved, but please feel free to reopen it or create a new one in case if the problem appears once again.