when:
  - event: pull_request
  - event: [push, tag, manual]
    branch: main

steps:
  test:
    image: python:${PYTHON_VERSION}-${DEBIAN_VERSION}
    commands:
      - apt-get update
      - apt-get install -y --no-install-recommends gettext make
      - pip install nox
      - nox -x --session "test-${PYTHON_VERSION}"

  docs:
    image: python:${PYTHON_VERSION}-${DEBIAN_VERSION}
    commands:
      - pip install nox
      - nox -x --session "docs"
    depends_on: []
    when:
      - matrix:
          PYTHON_VERSION: 3.14

  lint:
    image: python:${PYTHON_VERSION}-${DEBIAN_VERSION}
    commands:
      - pip install nox
      - nox -x -t lint
    depends_on: []
    when:
      - matrix:
          PYTHON_VERSION: 3.14

  standardjs:
    image: node:22-${DEBIAN_VERSION}
    commands:
      - make ci-install-standardjs
      - make standardjs
    depends_on: []
    when:
      - matrix:
          PYTHON_VERSION: 3.14

matrix:
  include:
    # To cut down on CI pipeline duration, test oldest/latest Python only.
    - PYTHON_VERSION: 3.10
      DEBIAN_VERSION: trixie
    - PYTHON_VERSION: 3.14
      DEBIAN_VERSION: trixie
