name: Go
on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4

    - uses: actions/setup-go@v5
      with:
        go-version: '>=1.17'

          #- name: Set environment
          #  run: echo "GOCOVERDIR=." >> $GITHUB_ENV

    - name: Build
      run: go build -v ./...

    - name: Test
      run: go test -race -count=1 ./...
        #run: go test -race -count=1 -coverprofile=coverage.out ./...

        #- name: Coverage
        #  uses: codecov/codecov-action@v3
        #  with:
        #    name: codecov
        #    token: ${{ secrets.CODECOV_TOKEN }}
        #    fail_ci_if_error: true

  golangci:
    name: lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-go@v5
        with:
          go-version: '>=1.17'

      - name: golangci-lint
        uses: golangci/golangci-lint-action@v4
        continue-on-error: true
        with:
          version: latest
