Skip to content

Commit

Permalink
Improve setup-go latency when using windows (#5158)
Browse files Browse the repository at this point in the history
* Set golang folders for windows runners, and start using cache, to improve CI performance
  • Loading branch information
MarcosDY authored May 17, 2024
1 parent f3ee2bf commit ba45cdd
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/pr_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,11 @@ jobs:
needs: images-windows
timeout-minutes: 45

env:
GOPATH: 'D:\golang\go'
GOCACHE: 'D:\golang\cache'
GOMODCACHE: 'D:\golang\modcache'

permissions:
contents: read

Expand All @@ -379,6 +384,7 @@ jobs:
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: 'go.mod'
cache: true
- name: Load cached deps
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
Expand Down Expand Up @@ -413,6 +419,11 @@ jobs:
runs-on: windows-2022
timeout-minutes: 45

env:
GOPATH: 'D:\golang\go'
GOCACHE: 'D:\golang\cache'
GOMODCACHE: 'D:\golang\modcache'

permissions:
contents: read

Expand All @@ -423,6 +434,7 @@ jobs:
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: 'go.mod'
cache: true
- name: Setup dep cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
Expand All @@ -437,6 +449,11 @@ jobs:
needs: cache-deps-windows
timeout-minutes: 45

env:
GOPATH: 'D:\golang\go'
GOCACHE: 'D:\golang\cache'
GOMODCACHE: 'D:\golang\modcache'

permissions:
contents: read

Expand All @@ -450,6 +467,7 @@ jobs:
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: 'go.mod'
cache: true
- name: Load cached deps
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
Expand Down Expand Up @@ -480,6 +498,11 @@ jobs:
needs: cache-deps-windows
timeout-minutes: 45

env:
GOPATH: 'D:\golang\go'
GOCACHE: 'D:\golang\cache'
GOMODCACHE: 'D:\golang\modcache'

permissions:
contents: read

Expand All @@ -493,6 +516,7 @@ jobs:
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: 'go.mod'
cache: true
- name: Load cached deps
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
Expand All @@ -514,6 +538,11 @@ jobs:
needs: cache-deps-windows
timeout-minutes: 45

env:
GOPATH: 'D:\golang\go'
GOCACHE: 'D:\golang\cache'
GOMODCACHE: 'D:\golang\modcache'

permissions:
contents: read

Expand All @@ -527,6 +556,7 @@ jobs:
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: 'go.mod'
cache: true
- name: Load cached deps
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
Expand Down

0 comments on commit ba45cdd

Please sign in to comment.