name: "Test Unit"

on:
  push:
    branches: [main]
    paths:
      - '**.go'
      - 'Makefile'
      - 'go.mod'
      - 'go.sum'
      - '.github/workflows/test-unit.yml'
  pull_request:
    branches: [main]
    paths:
      - '**.go'
      - 'Makefile'
      - 'go.mod'
      - 'go.sum'
      - '.github/workflows/test-unit.yml'

jobs:
  unit-tests:
    name: "Unit Tests"
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - name: "Check out"
        uses: actions/checkout@v2

      - name: "Setup Go"
        uses: actions/setup-go@v1
        with:
          go-version: 1.16

      - name: Test
        run: |
          make test
