linzhengen / tech-notes

My tech notes write in github issues🧲
1 stars 0 forks source link

[20240514] Disable the cache for GitHub self-hosted runner because it was too slow #204

Open linzhengen opened 4 months ago

linzhengen commented 4 months ago

Restoring cache is too slow

/Users/gh-runner/Library/Caches/go-build
Received 0 of 431509432 (0.0%), 0.0 MBs/sec
Received 0 of 431509432 (0.0%), 0.0 MBs/sec
Received 0 of 431509432 (0.0%), 0.0 MBs/sec
...
Received 8388608 of 431509432 (1.9%), 0.8 MBs/sec
Received 12582912 of 431509432 (2.9%), 1.1 MBs/sec
Received 12582912 of 431509432 (2.9%), 1.0 MBs/sec
...
Received 373293056 of 431509432 (86.5%), 2.4 MBs/sec
Received 377487360 of 431509432 (87.5%), 2.4 MBs/sec
Received 381681664 of 431509432 (88.5%), 2.4 MBs/sec
Received 385875968 of 431509432 (89.4%), 2.4 MBs/sec
...
Received 398458880 of 431509432 (92.3%), 2.4 MBs/sec
Received 398458880 of 431509432 (92.3%), 2.4 MBs/sec
Received 402653184 of 431509432 (93.3%), 2.4 MBs/sec
Received 406847488 of 431509432 (94.3%), 2.4 MBs/sec
Received 411041792 of 431509432 (95.3%), 2.4 MBs/sec
Received 411041792 of 431509432 (95.3%), 2.4 MBs/sec
...
Received 423120824 of 431509432 (98.1%), 2.4 MBs/sec
Received 423120824 of 431509432 (98.1%), 2.4 MBs/sec
Received 423120824 of 431509432 (98.1%), 2.4 MBs/sec
Received 423120824 of 431509432 (98.1%), 2.4 MBs/sec
...
Cache Size: ~412 MB (431509432 B)

Example

jobs:
  check-go-mod:
    runs-on: self-hosted
    steps:
...
      - uses: actions/setup-go@v5
        with:
          go-version-file: /go.mod
          check-latest: true
          cache: false
      - name: check go mod
        run: |
          go mod tidy
          git diff --exit-code go.mod
          git diff --exit-code go.sum