github.com/hamba/avro@v1.8.0/.github/workflows/test.yml (about)

     1  on:
     2    push:
     3      branches:
     4        - master
     5    pull_request:
     6  
     7  name: run tests
     8  jobs:
     9    test:
    10  
    11      strategy:
    12        matrix:
    13          go-version: [ 1.17, 1.18 ]
    14      runs-on: ubuntu-latest
    15      env:
    16        GOLANGCI_LINT_VERSION: v1.45.0
    17  
    18      steps:
    19        - name: Install Go
    20          if: success()
    21          uses: actions/setup-go@v2
    22          with:
    23            go-version: ${{ matrix.go-version }}
    24  
    25        - name: Checkout code
    26          uses: actions/checkout@v2
    27  
    28        - name: Cache Go modules
    29          uses: actions/cache@v2
    30          with:
    31            path: ~/go/pkg/mod
    32            key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
    33            restore-keys: |
    34              ${{ runner.os }}-go-
    35  
    36        - name: Run linter
    37          uses: golangci/golangci-lint-action@v2
    38          with:
    39            version: ${{ env.GOLANGCI_LINT_VERSION }}
    40            skip-pkg-cache: true
    41            args: --go ${{ matrix.go-version }}
    42  
    43        - name: Run tests
    44          run: go test -covermode=count -coverprofile=coverage.out ./...
    45  
    46        - name: Convert coverage.out to coverage.lcov
    47          uses: jandelgado/gcov2lcov-action@v1.0.6
    48        - name: Coveralls
    49          uses: coverallsapp/github-action@v1.1.2
    50          with:
    51            github-token: ${{ secrets.GITHUB_TOKEN }}
    52            path-to-lcov: coverage.lcov