|
| 1 | +# This workflow comes from https://github.com/ofek/hatch-mypyc |
| 2 | +# https://github.com/ofek/hatch-mypyc/blob/5a198c0ba8660494d02716cfc9d79ce4adfb1442/.github/workflows/test.yml |
| 3 | +name: Test / azure_doc_intelligence |
| 4 | + |
| 5 | +on: |
| 6 | + schedule: |
| 7 | + - cron: "0 0 * * *" |
| 8 | + pull_request: |
| 9 | + paths: |
| 10 | + - "integrations/azure_doc_intelligence/**" |
| 11 | + - "!integrations/azure_doc_intelligence/*.md" |
| 12 | + - ".github/workflows/azure_doc_intelligence.yml" |
| 13 | + |
| 14 | +concurrency: |
| 15 | + group: azure_doc_intelligence-${{ github.head_ref }} |
| 16 | + cancel-in-progress: true |
| 17 | + |
| 18 | +env: |
| 19 | + PYTHONUNBUFFERED: "1" |
| 20 | + FORCE_COLOR: "1" |
| 21 | + AZURE_DI_ENDPOINT: ${{ secrets.AZURE_DI_ENDPOINT }} |
| 22 | + AZURE_AI_API_KEY: ${{ secrets.AZURE_AI_API_KEY }} |
| 23 | + |
| 24 | +defaults: |
| 25 | + run: |
| 26 | + working-directory: integrations/azure_doc_intelligence |
| 27 | + |
| 28 | +jobs: |
| 29 | + run: |
| 30 | + name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} |
| 31 | + runs-on: ${{ matrix.os }} |
| 32 | + strategy: |
| 33 | + fail-fast: false |
| 34 | + max-parallel: 3 |
| 35 | + matrix: |
| 36 | + os: [ubuntu-latest, windows-latest] |
| 37 | + python-version: ["3.10", "3.13"] |
| 38 | + |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v6 |
| 41 | + |
| 42 | + - name: Set up Python ${{ matrix.python-version }} |
| 43 | + uses: actions/setup-python@v6 |
| 44 | + with: |
| 45 | + python-version: ${{ matrix.python-version }} |
| 46 | + |
| 47 | + - name: Install Hatch |
| 48 | + run: pip install --upgrade hatch |
| 49 | + |
| 50 | + - name: Lint |
| 51 | + if: matrix.python-version == '3.10' && runner.os == 'Linux' |
| 52 | + run: hatch run fmt-check && hatch run test:types |
| 53 | + |
| 54 | + - name: Generate docs |
| 55 | + if: matrix.python-version == '3.10' && runner.os == 'Linux' |
| 56 | + run: hatch run docs |
| 57 | + |
| 58 | + - name: Run tests |
| 59 | + run: hatch run test:cov-retry |
| 60 | + |
| 61 | + - name: Run unit tests with lowest direct dependencies |
| 62 | + run: | |
| 63 | + hatch run uv pip compile pyproject.toml --resolution lowest-direct --output-file requirements_lowest_direct.txt |
| 64 | + hatch -e test env run -- uv pip install -r requirements_lowest_direct.txt |
| 65 | + hatch run test:unit |
| 66 | +
|
| 67 | + - name: Nightly - run unit tests with Haystack main branch |
| 68 | + if: github.event_name == 'schedule' |
| 69 | + run: | |
| 70 | + hatch env prune |
| 71 | + hatch -e test env run -- uv pip install git+https://github.com/deepset-ai/haystack.git@main |
| 72 | + hatch run test:unit |
| 73 | +
|
| 74 | + - name: Send event to Datadog for nightly failures |
| 75 | + if: failure() && github.event_name == 'schedule' |
| 76 | + uses: ./.github/actions/send_failure |
| 77 | + with: |
| 78 | + title: | |
| 79 | + Core integrations nightly tests failure: ${{ github.workflow }} |
| 80 | + api-key: ${{ secrets.CORE_DATADOG_API_KEY }} |
0 commit comments