github.com/gophercloud/gophercloud@v1.11.0/.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 coverallsapp/github-action 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        - uses: actions/checkout@v3
    24  
    25        - name: Setup Go v1
    26          uses: actions/setup-go@v4
    27          with:
    28            go-version: 1
    29  
    30        - name: Install tools
    31          run: |
    32            go install github.com/wadey/gocovmerge@master
    33            go install golang.org/x/tools/cmd/goimports@latest
    34  
    35        - if: ${{ matrix.go-version != '1' }}
    36          name: Setup Go ${{ matrix.go-version }}
    37          uses: actions/setup-go@v4
    38          with:
    39            go-version: ${{ matrix.go-version }}
    40  
    41        - name: Run go vet
    42          run: |
    43            go vet ./...
    44  
    45        - name: Run unit tests
    46          run: |
    47            go version
    48            ./script/coverage
    49            ./script/format
    50            ./script/unittest -v
    51  
    52        - name: Coveralls Parallel
    53          uses: coverallsapp/github-action@v2
    54          with:
    55            file: cover.out
    56            flag-name: Go-${{ matrix.go-version }}
    57            parallel: true
    58  
    59    finish:
    60      permissions:
    61        checks: write  # for coverallsapp/github-action to create a new check based on the results
    62      needs: test
    63      if: ${{ always() }}
    64      runs-on: ubuntu-latest
    65      steps:
    66      - name: Coveralls Finished
    67        uses: coverallsapp/github-action@v2
    68        with:
    69          parallel-finished: true
    70          carryforward: Go-${{ join(matrix.go-version.*, '-') }}