name: Feature-Format Tests
on:
  workflow_dispatch:
    inputs:
      extra-r-packages:
        description: "extra R package to install for the runs (like a dev version of one of the deps) - comma separated, passed to renv::install"
        required: false
        type: string
        default: ""
  schedule:
    # run daily at 1am UTC
    - cron: "0 1 * * *"
  push:
    branches: [main]
    paths-ignore:
      - "news/**"
      - "src/resources/language/**"
      - ".github/workflows/create-release.yml"
      - ".github/workflows/performance-check.yml"
      - ".github/workflows/stale-needs-repro.yml"
      - ".github/workflows/test-bundle.yml"
      - ".github/workflows/test-smokes-parallel.yml"
      - ".github/workflows/test-install.yml"
      - ".github/workflows/test-quarto-latexmk.yml"
      - ".github/workflows/update-test-timing.yml"
  pull_request:
    branches: [main]
    paths-ignore:
      - "news/**"
      - "src/resources/language/**"
      - ".github/workflows/create-release.yml"
      - ".github/workflows/performance-check.yml"
      - ".github/workflows/stale-needs-repro.yml"
      - ".github/workflows/test-bundle.yml"
      - ".github/workflows/test-install.yml"
      - ".github/workflows/test-smokes-parallel.yml"
      - ".github/workflows/test-quarto-latexmk.yml"
      - ".github/workflows/update-test-timing.yml"

concurrency:
  group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  run-feature-format-tests:
    name: Run feature-format matrix
    uses: ./.github/workflows/test-smokes.yml
    with:
      buckets: '[ "../dev-docs/feature-format-matrix/qmd-files/**/*.qmd" ]'
      extra-r-packages: ${{ inputs.extra-r-packages }}
