name: build

# Triggers the workflow on push or pull request events
on: [push, pull_request]

jobs:
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - uses: actions/checkout@v2
    
    # Install Go
    - name: Install Go
      uses: actions/setup-go@v2
      with:
        go-version: '1.16'
    
    # Install dependencies
    - name: Install dependencies
      run: |
        go version
        go get -u golang.org/x/lint/golint
        go get -t -v ./...

    # Build project
    - name: Build project
      run: go build .
      
    # Run go vet & golint
    - name: Run go vet & golint
      run: |
        go vet .
        golint .
    
    # Run tests
    - name: Run tests
      run: go test -race -coverprofile=coverage.txt -covermode=atomic

    # Upload coverage report to Codecov
    - name: Report to Codecov
      uses: codecov/codecov-action@v1.4.0
      with:
        file: ./coverage.txt
        # fail_ci_if_error: true # optional (default = false)

name: build

# Triggers the workflow on push or pull request events
on: [push, pull_request]

jobs:
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - uses: actions/checkout@v2
    
    # Install Go
    - name: Install Go
      uses: actions/setup-go@v2
      with:
        go-version: '1.16'
    
    # Install dependencies
    - name: Install dependencies
      run: |
        go version
        go get -u golang.org/x/lint/golint
        go get -t -v ./...

    # Build project
    - name: Build project
      run: go build .
      
    # # Run go vet & golint
    # - name: Run go vet & golint
    #   run: |
    #     go vet .
    #     golint .
    
    # Run tests
    - name: Run tests
      run: go test -race -coverprofile=coverage.txt -covermode=atomic

    # Upload coverage report to Codecov
    - name: Report to Codecov
      uses: codecov/codecov-action@v1.4.0
      with:
        file: ./coverage.txt
        # fail_ci_if_error: true # optional (default = false)

Disable Go vet and golint
Disable Go vet and golint
