| 1 |
# CI for specifically ensuring integrations work fine (`transformers` mainly) |
| 2 |
# Useful tips: |
| 3 |
# - New integrations to test should have its own job, and follow a strategy method where we check both |
| 4 |
# the pypi and github versions. |
| 5 |
# - When checking the latest release of the integration, use |
| 6 |
# git checkout $(git describe --tags `git rev-list --tags --max-count=1`) to get the latest release. |
| 7 |
|
| 8 |
name: Integration Tests |
| 9 |
|
| 10 |
on: |
| 11 |
pull_request: |
| 12 |
paths: |
| 13 |
- "src/**" |
| 14 |
- "tests/**" |
| 15 |
- ".github/**" |
| 16 |
- "examples/**" |
| 17 |
- "setup.py" |
| 18 |
types: [opened, synchronize, reopened] |
| 19 |
|
| 20 |
env: |
| 21 |
HF_HOME: ~/hf_cache |
| 22 |
|
| 23 |
jobs: |
| 24 |
run-trainer-tests: |
| 25 |
runs-on: ubuntu-latest |
| 26 |
strategy: |
| 27 |
fail-fast: false |
| 28 |
steps: |
| 29 |
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 30 |
- name: Set up python 3.10 |
| 31 |
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 |
| 32 |
with: |
| 33 |
python-version: '3.10' |
| 34 |
cache: 'pip' |
| 35 |
cache-dependency-path: 'setup.py' |
| 36 |
|
| 37 |
- name: Install Accelerate from source |
| 38 |
run: | |
| 39 |
pip install --upgrade pip |
| 40 |
pip install -e . |
| 41 |
|
| 42 |
- name: Clone and install transformers |
| 43 |
run: | |
| 44 |
cd .. |
| 45 |
git clone https://github.com/huggingface/transformers |
| 46 |
cd transformers |
| 47 |
pip install .[torch,testing] |
| 48 |
|
| 49 |
- name: Show installed libraries |
| 50 |
run: | |
| 51 |
pip freeze |
| 52 |
|
| 53 |
- name: Run Trainer tests |
| 54 |
env: |
| 55 |
WANDB_DISABLED: true |
| 56 |
run: | |
| 57 |
cd ../transformers |
| 58 |
pytest -sv tests/trainer |