2022-08-26 09:34:58 -06:00
|
|
|
name: Run non-slow tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
2022-09-01 08:14:53 -06:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-08-26 09:34:58 -06:00
|
|
|
env:
|
|
|
|
HF_HOME: /mnt/cache
|
|
|
|
OMP_NUM_THREADS: 8
|
|
|
|
MKL_NUM_THREADS: 8
|
|
|
|
PYTEST_TIMEOUT: 60
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
run_tests_cpu:
|
|
|
|
name: Diffusers tests
|
|
|
|
runs-on: [ self-hosted, docker-gpu ]
|
|
|
|
container:
|
|
|
|
image: python:3.7
|
|
|
|
options: --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout diffusers
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
python -m pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
|
|
|
|
python -m pip install -e .[quality,test]
|
|
|
|
|
|
|
|
- name: Environment
|
|
|
|
run: |
|
|
|
|
python utils/print_env.py
|
|
|
|
|
|
|
|
- name: Run all non-slow selected tests on CPU
|
|
|
|
run: |
|
2022-09-19 09:08:29 -06:00
|
|
|
python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile -s -v --make-reports=tests_torch_cpu tests/
|
|
|
|
|
|
|
|
- name: Failure short reports
|
|
|
|
if: ${{ failure() }}
|
|
|
|
run: cat reports/tests_torch_cpu_failures_short.txt
|
|
|
|
|
|
|
|
- name: Test suite reports artifacts
|
|
|
|
if: ${{ always() }}
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: pr_torch_test_reports
|
|
|
|
path: reports
|