Repository navigation
82 lines (78 loc) · 2.89 KB
/
Copy pathcompat.yml
File metadata and controls
82 lines (78 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Compatibility
# Runs tests/compat against the pinned library versions in
# scripts/compat_matrix.py, which is also the source of the job matrix and of
# docs/compatibility.md.
#
# Every run uses the full matrix. It runs on pull requests into main or a
# release branch, on pushes to them, nightly against devel, and on demand.
on:
push:
branches: [ main, 'release/**' ]
paths:
- 'wildedge/**'
- 'tests/compat/**'
- 'scripts/compat_matrix.py'
- 'pyproject.toml'
- '.github/workflows/compat.yml'
pull_request:
branches: [ main, 'release/**' ]
types: [opened, synchronize, reopened]
paths:
- 'wildedge/**'
- 'tests/compat/**'
- 'scripts/compat_matrix.py'
- 'pyproject.toml'
- '.github/workflows/compat.yml'
schedule:
- cron: "0 3 * * *"
workflow_dispatch:
jobs:
matrix:
runs-on: ubuntu-latest
outputs:
rows: ${{ steps.rows.outputs.rows }}
steps:
- uses: actions/checkout@v4
- id: rows
run: echo "rows=$(python scripts/compat_matrix.py github-matrix)" >> "$GITHUB_OUTPUT"
compat:
needs: matrix
name: compat (${{ matrix.python-version }}, ${{ matrix.integration }}, ${{ matrix.version-set }})
runs-on: ${{ matrix.runs-on }}
continue-on-error: ${{ matrix.canary }}
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.matrix.outputs.rows) }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install project
run: |
python -m pip install --upgrade pip
pip install -e . pytest pytest-asyncio pytest-mock
- name: Install compatibility dependencies
run: |
python scripts/compat_matrix.py deps \
--integration "${{ matrix.integration }}" \
--version-set "${{ matrix.version-set }}" \
--python-version "${{ matrix.python-version }}" > compat-requirements.txt
pip install -r compat-requirements.txt
- name: Check installed versions match the pins
run: |
python scripts/compat_matrix.py verify \
--integration "${{ matrix.integration }}" \
--version-set "${{ matrix.version-set }}" \
--python-version "${{ matrix.python-version }}"
- name: Cache downloaded test models
if: matrix.integration == 'llama_cpp' || matrix.integration == 'faster_whisper'
uses: actions/cache@v4
with:
path: |
tests/compat/.cache
~/.cache/huggingface/hub
key: compat-models-${{ matrix.integration }}-${{ hashFiles(format('tests/compat/test_{0}_compat.py', matrix.integration)) }}
- name: Run compatibility tests
run: python -m pytest "tests/compat/test_${{ matrix.integration }}_compat.py" -q -rxX