name: covgen
on: 
  workflow_dispatch:
  workflow_run:
    workflows: ["Generate Docs"]
    branches: [main]
    types: 
      - completed
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '20' 
      - name: Install
        run: yarn install
      - name: Test and Coverage
        run: yarn coverage
      - name: Update Coverage Badge
        if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
        uses: we-cli/coverage-badge-action@main