| 1 |
name: Run Tests |
| 2 |
|
| 3 |
on: |
| 4 |
pull_request: |
| 5 |
paths: |
| 6 |
- "src/**" |
| 7 |
- "tests/**" |
| 8 |
- ".github/**" |
| 9 |
- "examples/**" |
| 10 |
- "setup.py" |
| 11 |
types: [opened, synchronize, reopened] |
| 12 |
|
| 13 |
env: |
| 14 |
HF_HOME: ~/hf_cache |
| 15 |
TESTING_MOCKED_DATALOADERS: "1" |
| 16 |
IS_GITHUB_CI: "1" |
| 17 |
|
| 18 |
jobs: |
| 19 |
run-tests: |
| 20 |
runs-on: |
| 21 |
group: aws-general-8-plus |
| 22 |
strategy: |
| 23 |
fail-fast: false |
| 24 |
matrix: |
| 25 |
pytorch-version: [ |
| 26 |
latest, |
| 27 |
minimum, |
| 28 |
] |
| 29 |
test-kind: [ |
| 30 |
test_prod, |
| 31 |
test_core, |
| 32 |
test_cli, |
| 33 |
test_big_modeling, |
| 34 |
test_deepspeed, |
| 35 |
test_fsdp, |
| 36 |
test_example_differences, |
| 37 |
test_checkpoint_step, |
| 38 |
test_checkpoint_epoch, |
| 39 |
test_rest |
| 40 |
] |
| 41 |
steps: |
| 42 |
- uses: actions/checkout@v6 |
| 43 |
- name: Set up python 3.10 |
| 44 |
uses: actions/setup-python@v6 |
| 45 |
with: |
| 46 |
python-version: '3.10' |
| 47 |
cache: 'pip' |
| 48 |
cache-dependency-path: 'setup.py' |
| 49 |
|
| 50 |
- name: Install the library |
| 51 |
run: | |
| 52 |
if [[ ${{ matrix.test-kind }} = test_prod ]]; then pip install -e .[test_prod]; fi |
| 53 |
if [[ ${{ matrix.test-kind }} != test_prod ]]; then pip install -e .[testing,test_trackers]; fi |
| 54 |
if [[ ${{ matrix.pytorch-version }} = minimum ]]; then pip install torchvision==0.19.0 torch==2.4.0; fi |
| 55 |
pip install pytest-reportlog tabulate setuptools importlib_metadata |
| 56 |
|
| 57 |
- name: Show installed libraries |
| 58 |
run: | |
| 59 |
pip freeze |
| 60 |
|
| 61 |
- name: Run Tests |
| 62 |
env: |
| 63 |
PYTORCH_VERSION: ${{ matrix.pytorch-version }} |
| 64 |
run: | |
| 65 |
make ${{ matrix.test-kind }} |
| 66 |
|
| 67 |
- name: Generate Report |
| 68 |
if: always() |
| 69 |
run: | |
| 70 |
python utils/log_reports.py >> $GITHUB_STEP_SUMMARY |