name: test
on:
  pull_request:
    branches:
      - 'develop'
      - 'main'
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - name: Set up Go 1.16
        uses: actions/setup-go@v2
        with:
          go-version: '^1.16'
      - run: go version

      - name: Check out code into the Go module directory
        uses: actions/checkout@v2

      - name: Build CLI
        run: make cli

      - shell: bash
        run: |
          sudo apt-get install libpcap-dev

      - name: Build Agent
        run: make agent

      - name: Test
        run: make test

      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v2
