github.com/leeclow-ops/gophercloud@v1.2.1/.github/workflows/unit.yml (about) 1 on: [push, pull_request] 2 name: Unit Testing 3 permissions: 4 contents: read 5 6 jobs: 7 test: 8 permissions: 9 checks: write # for shogo82148/actions-goveralls to create a new check based on the results 10 contents: read # for actions/checkout to fetch code 11 runs-on: ubuntu-latest 12 strategy: 13 fail-fast: false 14 matrix: 15 go-version: 16 - "1.14" 17 - "1" 18 19 env: 20 GO111MODULE: "on" 21 22 steps: 23 - name: Setup Go ${{ matrix.go-version }} 24 uses: actions/setup-go@v4 25 with: 26 go-version: ${{ matrix.go-version }} 27 28 - uses: actions/checkout@v3 29 30 - name: Setup environment 31 run: | 32 # Changing into a different directory to avoid polluting go.sum with "go get" 33 cd "$(mktemp -d)" 34 35 # we use "go get" for Go v1.14 36 go install github.com/wadey/gocovmerge@master || go get github.com/wadey/gocovmerge 37 go install golang.org/x/tools/cmd/goimports@latest || go get golang.org/x/tools/cmd/goimports 38 39 - name: Run go vet 40 run: | 41 go vet ./... 42 43 - name: Run unit tests 44 run: | 45 ./script/coverage 46 ./script/format 47 ./script/unittest -v 48 49 - uses: shogo82148/actions-goveralls@v1 50 with: 51 path-to-profile: cover.out 52 flag-name: Go-${{ matrix.go-version }} 53 parallel: true 54 55 finish: 56 permissions: 57 checks: write # for shogo82148/actions-goveralls to create a new check based on the results 58 needs: test 59 runs-on: ubuntu-latest 60 steps: 61 - uses: shogo82148/actions-goveralls@v1 62 with: 63 parallel-finished: true