Skip to content

Commit c92af9b

Browse files
committed
fix windows build
1 parent 05801fa commit c92af9b

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

.github/workflows/build-windows.yaml

+20-20
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ on:
1515
- 'docs/**'
1616
- '**.md'
1717

18+
concurrency:
19+
group: "${{ github.workflow }}-${{ github.ref }}"
20+
cancel-in-progress: true
21+
1822
env:
19-
GO_VERSION: '1.18'
20-
GOSEC_VERSION: '2.12.0'
23+
GO_VERSION: '1.19'
24+
GOSEC_VERSION: '2.14.0'
2125

2226
jobs:
2327
build-ovs-and-ovn:
@@ -128,31 +132,28 @@ jobs:
128132
name: Build Kube-OVN
129133
runs-on: windows-2019
130134
steps:
131-
- name: Set up Go 1.x
132-
uses: actions/setup-go@v3
135+
- uses: actions/checkout@v3
136+
- uses: actions/setup-go@v3
133137
with:
134138
go-version: '${{ env.GO_VERSION }}'
135139
check-latest: true
136140
id: go
137141

138-
- name: Check out code
139-
uses: actions/checkout@v3
140-
141-
- name: Go Build Cache
142-
uses: actions/cache@v3
143-
with:
144-
path: /home/runner/.cache/go-build
145-
key: ${{ runner.os }}-go-x86-build-${{ hashFiles('**/go.sum') }}
146-
restore-keys: |
147-
${{ runner.os }}-go-x86-build-
142+
- name: Export Go full version
143+
run: |
144+
$goVersion = (go version).Split()[2]
145+
$entry = [string]::Format("GO_FULL_VER={0}", $goVersion)
146+
Add-Content -Path $env:GITHUB_ENV -Value $entry
148147
149-
- name: Go Mod Cache
148+
- name: Go Cache
150149
uses: actions/cache@v3
151150
with:
152-
path: ~/go/pkg/mod
153-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
151+
path: |
152+
~\AppData\Local\go-build
153+
~\go\pkg\mod
154+
key: ${{ runner.os }}-${{ env.GO_FULL_VER }}-${{ hashFiles('**/go.sum') }}
154155
restore-keys: |
155-
${{ runner.os }}-go-
156+
${{ runner.os }}-${{ env.GO_FULL_VER }}-
156157
157158
- name: Install gosec
158159
run: |
@@ -182,8 +183,7 @@ jobs:
182183
- build-kube-ovn
183184
runs-on: windows-2019
184185
steps:
185-
- name: Check out code
186-
uses: actions/checkout@v3
186+
- uses: actions/checkout@v3
187187

188188
- name: Download Kube-OVN binaries
189189
uses: actions/download-artifact@v3

0 commit comments

Comments
 (0)