Skip to content

Commit

Permalink
chore: Optimize Go CI workflows
Browse files Browse the repository at this point in the history
Closes: #2828
Signed-off-by: Michael Gasch <mgasch@vmware.com>
  • Loading branch information
Michael Gasch committed Apr 26, 2022
1 parent 919f21a commit d60b21d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/govmomi-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ on:

workflow_dispatch:

concurrency:
group: govmomi-build-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
artifacts:
name: Build Snapshot Release (no upload)
Expand All @@ -50,9 +54,9 @@ jobs:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-1.18-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
${{ runner.os }}-go-1.18-
- name: Create CHANGELOG
env:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/govmomi-go-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
matrix:
go-version: ["1.17", "1.18"]
platform: ["ubuntu-20.04"]
fail-fast: false

runs-on: ${{ matrix.platform }}
timeout-minutes: 10
Expand All @@ -48,9 +49,9 @@ jobs:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
${{ runner.os }}-go-${{ matrix.go-version }}-
- name: Run Tests
env:
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/govmomi-govc-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,21 @@ on:
pull_request:
branches: ["main", "master"]

concurrency:
group: govmomi-govc-tests-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
govc-tests:
name: Run govc Tests
strategy:
fail-fast: false
matrix:
go-version: ["1.17", "1.18"]
platform: ["ubuntu-20.04"]
cmd: ["govc-test"]
experimental: [false]
timeout: [10]
timeout: [20]
include:
- go-version: "1.18"
platform: "ubuntu-20.04"
Expand Down Expand Up @@ -63,9 +68,9 @@ jobs:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
${{ runner.os }}-go-${{ matrix.go-version }}-
- name: Run ${{ matrix.cmd }}
run: |
Expand Down Expand Up @@ -97,9 +102,9 @@ jobs:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
${{ runner.os }}-go-${{ matrix.go-version }}-
- name: Run "make doc"
run: |
Expand Down

0 comments on commit d60b21d

Please sign in to comment.