github.com/vmware/govmomi@v0.43.0/.github/workflows/govmomi-go-tests.yaml (about) 1 # Copyright (c) 2021 VMware, Inc. All Rights Reserved. 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 name: Unit Tests 16 17 on: 18 push: 19 branches: [ 'main' ] 20 21 pull_request: 22 branches: [ 'main' ] 23 24 jobs: 25 go-tests: 26 name: Run Unit Tests 27 strategy: 28 matrix: 29 go-version: ["1.21", "1.22"] 30 platform: ["ubuntu-20.04"] 31 fail-fast: false 32 33 runs-on: ${{ matrix.platform }} 34 timeout-minutes: 10 35 36 steps: 37 - name: Check out code 38 uses: actions/checkout@v4 39 40 - name: Set up Go ${{ matrix.go-version }} 41 uses: actions/setup-go@v5 42 with: 43 go-version: ${{ matrix.go-version }} 44 id: go 45 46 - name: Restore Go cache 47 uses: actions/cache@v4 48 with: 49 path: | 50 ~/.cache/go-build 51 ~/go/pkg/mod 52 key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} 53 restore-keys: | 54 ${{ runner.os }}-go-${{ matrix.go-version }}- 55 56 - name: Run Tests 57 env: 58 TEST_COUNT: 1 59 TEST_RACE_HISTORY_SIZE: 5 60 TEST_TIMEOUT: 5m 61 TEST_OPTS: "" 62 run: make go-test 63 - name: Debug with tmate on failure 64 if: ${{ failure() }} 65 uses: mxschmitt/action-tmate@v3