name: Test

on:
  push:
    tags-ignore:
    - 'v*'
    branches:
    - "**"
  pull_request:

jobs:
  lintTestBuild:
    name: Lint, Test, Build
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        go: [ '1.17', '1.18' ]
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Setup Go
        uses: actions/setup-go@v2
        with:
          go-version: ${{ matrix.go }}
      -
        name: golangci-lint
        uses: golangci/golangci-lint-action@v2
        with:
          version: 'v1.45.2'
          args: --timeout=30m
      -
        name: Test, Build
        id: lintTestBuild
        run: V=1 make
      -
        name: Codecov
        uses: codecov/codecov-action@v1.2.1
        if: matrix.go == '1.18'
        with:
          file: ./coverage.out
          name: codecov-umbrella
          fail_ci_if_error: true

