Skip to content

Commit d60b21d

Browse files
author
Michael Gasch
committed
chore: Optimize Go CI workflows
Closes: #2828 Signed-off-by: Michael Gasch <[email protected]>
1 parent 919f21a commit d60b21d

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

.github/workflows/govmomi-build.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ on:
2727

2828
workflow_dispatch:
2929

30+
concurrency:
31+
group: govmomi-build-${{ github.head_ref || github.run_id }}
32+
cancel-in-progress: true
33+
3034
jobs:
3135
artifacts:
3236
name: Build Snapshot Release (no upload)
@@ -50,9 +54,9 @@ jobs:
5054
path: |
5155
~/.cache/go-build
5256
~/go/pkg/mod
53-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
57+
key: ${{ runner.os }}-go-1.18-${{ hashFiles('**/go.sum') }}
5458
restore-keys: |
55-
${{ runner.os }}-go-
59+
${{ runner.os }}-go-1.18-
5660
5761
- name: Create CHANGELOG
5862
env:

.github/workflows/govmomi-go-tests.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
matrix:
2929
go-version: ["1.17", "1.18"]
3030
platform: ["ubuntu-20.04"]
31+
fail-fast: false
3132

3233
runs-on: ${{ matrix.platform }}
3334
timeout-minutes: 10
@@ -48,9 +49,9 @@ jobs:
4849
path: |
4950
~/.cache/go-build
5051
~/go/pkg/mod
51-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
52+
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
5253
restore-keys: |
53-
${{ runner.os }}-go-
54+
${{ runner.os }}-go-${{ matrix.go-version }}-
5455
5556
- name: Run Tests
5657
env:

.github/workflows/govmomi-govc-tests.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,21 @@ on:
2121
pull_request:
2222
branches: ["main", "master"]
2323

24+
concurrency:
25+
group: govmomi-govc-tests-${{ github.head_ref || github.run_id }}
26+
cancel-in-progress: true
27+
2428
jobs:
2529
govc-tests:
2630
name: Run govc Tests
2731
strategy:
32+
fail-fast: false
2833
matrix:
2934
go-version: ["1.17", "1.18"]
3035
platform: ["ubuntu-20.04"]
3136
cmd: ["govc-test"]
3237
experimental: [false]
33-
timeout: [10]
38+
timeout: [20]
3439
include:
3540
- go-version: "1.18"
3641
platform: "ubuntu-20.04"
@@ -63,9 +68,9 @@ jobs:
6368
path: |
6469
~/.cache/go-build
6570
~/go/pkg/mod
66-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
71+
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
6772
restore-keys: |
68-
${{ runner.os }}-go-
73+
${{ runner.os }}-go-${{ matrix.go-version }}-
6974
7075
- name: Run ${{ matrix.cmd }}
7176
run: |
@@ -97,9 +102,9 @@ jobs:
97102
path: |
98103
~/.cache/go-build
99104
~/go/pkg/mod
100-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
105+
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
101106
restore-keys: |
102-
${{ runner.os }}-go-
107+
${{ runner.os }}-go-${{ matrix.go-version }}-
103108
104109
- name: Run "make doc"
105110
run: |

0 commit comments

Comments
 (0)