github.com/hamba/slices@v0.2.1-0.20220316050741-75c057d92699/.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.15, 1.16 ]
    14      runs-on: ubuntu-latest
    15      env:
    16        GOLANGCI_LINT_VERSION: v1.41.1
    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        - name: Run linter
    36          uses: golangci/golangci-lint-action@v2
    37          with:
    38            version: ${{ env.GOLANGCI_LINT_VERSION }}
    39  
    40        - name: Run tests
    41          run: go test -covermode=count -coverprofile=coverage.out ./...
    42  
    43        - name: Convert coverage.out to coverage.lcov
    44          uses: jandelgado/gcov2lcov-action@v1.0.6
    45        - name: Coveralls
    46          uses: coverallsapp/github-action@v1.1.2
    47          with:
    48            github-token: ${{ secrets.GITHUB_TOKEN }}
    49            path-to-lcov: coverage.lcov