Run Tests #5132
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Tests | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- "src/**" | |
- "tests/**" | |
- ".github/**" | |
- "examples/**" | |
- "setup.py" | |
types: [opened, synchronize, reopened] | |
env: | |
HF_HOME: ~/hf_cache | |
TESTING_MOCKED_DATALOADERS: "1" | |
IS_GITHUB_CI: "1" | |
jobs: | |
run-tests: | |
env: | |
UV_HTTP_TIMEOUT: 600 # max 10min to install deps | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
pytorch-version: [ | |
latest, | |
minimum, | |
] | |
test-kind: [ | |
test_prod, | |
test_core, | |
test_cli, | |
test_big_modeling, | |
test_deepspeed, | |
test_fsdp, | |
test_example_differences, | |
test_checkpoint_step, | |
test_checkpoint_epoch, | |
test_rest | |
] | |
steps: | |
- uses: actions/checkout@v3.1.0 | |
- name: Set up python 3.9 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.9 | |
- name: Print python version | |
run: python --version | |
- name: Install uv | |
run: pip install -U uv | |
- name: Install the library | |
run: | | |
if [[ ${{ matrix.test-kind }} = test_prod ]]; then uv pip install --system -e .[test_prod]; fi | |
if [[ ${{ matrix.test-kind }} != test_prod ]]; then uv pip install --system -e .[testing,test_trackers]; fi | |
if [[ ${{ matrix.test-kind }} = test_rest ]]; then uv pip uninstall --system comet_ml; fi | |
if [[ ${{ matrix.pytorch-version }} = minimum ]]; then uv pip install --system torchvision==0.18.1 torch==2.3.1; fi | |
uv pip install --system pytest-reportlog tabulate setuptools | |
- name: Show installed libraries | |
run: | | |
pip freeze | |
- name: Run Tests | |
env: | |
PYTORCH_VERSION: ${{ matrix.pytorch-version }} | |
run: | | |
make ${{ matrix.test-kind }} | |
- name: Generate Report | |
if: always() | |
run: | | |
python utils/log_reports.py >> $GITHUB_STEP_SUMMARY |