name: Build

on:
  push:
  pull_request:

jobs:
  build:
    uses: charmbracelet/meta/.github/workflows/build.yml@main

  codecov:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-go@v4
        with:
          go-version: '^1'
          cache: true
      - run: go test -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./... -timeout 5m
      - uses: codecov/codecov-action@v3
        with:
          file: ./coverage.txt
