name: CairoSVG's tests
on: [push, pull_request]

jobs:
  tests:
    name: ${{ matrix.os }} - ${{ matrix.python-version }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
        python-version: ['3.9', '3.13']
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: true
      - uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install CairoSVG
        run: pip install --upgrade -e.[test]
      - name: Setup fonts
        run: |
          mkdir ~/.fonts
          cp ./test_non_regression/resources/*.*tf ~/.fonts
          fc-cache -f -v
      - name: Install tests’ requirements
        run: python -m pip install .[test] pytest-xdist
      - name: Launch tests
        run: python -m pytest -n auto
      - name: Check coding style
        run: python -m flake8
      - name: Check imports order
        run: python -m isort . --check --diff
