name: ci

on: [push, pull_request]

jobs:
  golangci:
    name: lint
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-go@v4
        with:
          go-version-file: 'go.mod'
      - name: golangci-lint
        uses: golangci/golangci-lint-action@v3

  unit:
    name: unit
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-go@v4
        with:
          go-version-file: 'go.mod'
      - run: |
          go test -race -timeout 240s ./...
