name: pr/push checks

on: [push, pull_request]

jobs:

  build:
    name: Build, Test, Coverage
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: 1.17

    - name: Lint
      uses: golangci/golangci-lint-action@v2

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

    - name: Test
      run: go test -v ./...
 
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v1
      with:
        language: 'go'

    - name: CodeQL Analysis
      uses: github/codeql-action/analyze@v1

name: pr/push checks

on: [push, pull_request]

jobs:

  build:
    name: Build, Test, Coverage
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: 1.17

    - name: Lint
      uses: golangci/golangci-lint-action@v2

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

    - name: Test
      run: go test -v ./...
 
    - name: Run coverage
      run: go test -race -coverprofile=coverage.out -covermode=atomic
    - name: Upload coverage to Codecov
      run: bash <(curl -s https://codecov.io/bash)
      
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v1
      with:
        language: 'go'

    - name: CodeQL Analysis
      uses: github/codeql-action/analyze@v1

Add coverage calc on each commit
Add coverage calc on each commit