name: CI
on: [push, pull_request]
jobs:
  tests:
    runs-on: ubuntu-latest
    env:
      GO111MODULE: on
    steps:
      - name: Checkout Source
        uses: actions/checkout@master
      - name: Run Tests
        uses: cedrickring/golang-action@1.6.0
        with:
          args: make test
  coverage:
    runs-on: ubuntu-latest
    env:
      GO111MODULE: on
    steps:
      - name: Checkout Source
        uses: actions/checkout@master
      - name: Run Tests
        uses: cedrickring/golang-action@1.6.0
        with:
          args: make test-coverage
      - name: Upload Test Coverage
        uses: codecov/codecov-action@v1
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          file: ./coverage.txt
          fail_ci_if_error: true
