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@v4
      - uses: actions/setup-go@v5
        with:
          go-version: "stable"
          cache: true
      - run: go test -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./... -timeout 5m
      - uses: codecov/codecov-action@v4
        with:
          file: ./coverage.txt
