---
name: Build and test
on:
  pull_request:
  push:
    branches: [master]

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - name: Check out source code
        uses: actions/checkout@v2

      - name: Set up Go
        uses: actions/setup-go@v3
        with:
          go-version: "1.18"
          check-latest: true
          cache: true

      - name: Build
        run: make build

      - name: Test
        run: make test

      - name: Dockerize
        run: docker build .