name: CI

on: [pull_request]

jobs:
  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
    - name: Setup
      uses: actions/setup-go@v2
      with:
        go-version: '1.14'
    - name: Checkout
      uses: actions/checkout@v2
    - name: Lint
      run: make lint

  test:
    name: Test
    runs-on: ubuntu-latest
    steps:
    - name: Setup
      uses: actions/setup-go@v2
      with:
        go-version: '1.14'
    - name: Checkout
      uses: actions/checkout@v2
    - name: Test
      run: make testci
    - name: Code coverage
      uses: codecov/codecov-action@v1
      with:
        file: ./coverage.txt

  regression_test:
    name: Regression Tests
    runs-on: ubuntu-latest
    strategy:
      matrix:
        go_version:
        - '1.11'
        - '1.12'
        - '1.13'
    steps:
    - name: Setup
      uses: actions/setup-go@v2
      with:
        go-version: ${{matrix.go_version}}
    - name: Checkout
      uses: actions/checkout@v2
    - name: Test
      run: make test
